Skip to main content

Module audit_logs

Module audit_logs 

Source
Expand description

File to handle logging audit events

This module provides functionality to log audit events into the database. It includes caching mechanisms for log types and action types to optimize performance and reduce database queries.

log_audit_event is the only required public function here that is importable to other files.

Structsยง

TypeRecord ๐Ÿ”’

Staticsยง

ACTION_TYPE_CACHE ๐Ÿ”’
LOG_TYPE_CACHE ๐Ÿ”’

Functionsยง

get_cached_action_type ๐Ÿ”’
Retrieves the cached action type ID for a given log name, or creates it if it doesnโ€™t exist.
get_cached_log_type ๐Ÿ”’
Retrieves the cached log type ID for a given log name, or creates it if it doesnโ€™t exist.
get_or_create_type ๐Ÿ”’
Retrieves or creates a type record in the specified table based on the given name.
log_audit_event
Logs an audit event.