diff options
author | Stan Hu <stanhu@gmail.com> | 2018-10-18 12:50:21 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-10-18 15:59:12 -0700 |
commit | 143d0e26664e85be9382d1b1f8e99ead96e5d642 (patch) | |
tree | 304f621e9a8fc1fc12849212cd59a1d7b79f2456 /lib | |
parent | 5edf87d0ac699575421ec96cbc0fc91ea0c3c078 (diff) | |
download | gitlab-ce-143d0e26664e85be9382d1b1f8e99ead96e5d642.tar.gz |
Add support for JSON logging for audit events
This will add audit_json.log that writes one line per audit event. For
example:
{
"severity":"INFO",
"time":"2018-10-17T17:38:22.523Z",
"author_id":3,
"entity_id":2,
"entity_type":"Project",
"change":"visibility",
"from":"Private",
"to":"Public",
"author_name":"John Doe4",
"target_id":2,
"target_type":"Project",
"target_details":"namespace2/project2"
}
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/audit_json_logger.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/gitlab/audit_json_logger.rb b/lib/gitlab/audit_json_logger.rb new file mode 100644 index 00000000000..12e0645f3e4 --- /dev/null +++ b/lib/gitlab/audit_json_logger.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module Gitlab + class AuditJsonLogger < Gitlab::JsonLogger + def self.file_name_noext + 'audit_json' + end + end +end |