You are here

function hook_audit_log in Audit Log 7

Save an audit log.

Parameters

Auditlog $log: The audit log to be saved.

4 functions implement hook_audit_log()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

audit_log_db_audit_log in modules/audit_log_db/audit_log_db.module
Implements hook_audit_log().
audit_log_elastic_search_audit_log in modules/audit_log_elastic_search/audit_log_elastic_search.module
Implements hook_audit_log().
audit_log_logs_http_audit_log in modules/audit_log_logs_http/audit_log_logs_http.module
Implements hook_audit_log().
audit_log_syslog_audit_log in modules/audit_log_syslog/audit_log_syslog.module
Implements hook_audit_log().
1 invocation of hook_audit_log()
Auditlog::log in includes/AuditLog.php
Logs this audit log.

File

./audit_log.api.php, line 75
API documentation for the Audit log module.

Code

function hook_audit_log(Auditlog $log) {
  $role_ids = $log->role_ids;
  drupal_write_record('audit_log', $log);
  foreach ($role_ids as $role_id) {
    $record = (object) array(
      'audit_log_id' => $log->id,
      'role_id' => $role_id,
    );
    drupal_write_record('audit_log_roles', $record);
  }
}