Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-10-18 22:50:21 +0300
committerStan Hu <stanhu@gmail.com>2018-10-19 01:59:12 +0300
commit143d0e26664e85be9382d1b1f8e99ead96e5d642 (patch)
tree304f621e9a8fc1fc12849212cd59a1d7b79f2456 /lib
parent5edf87d0ac699575421ec96cbc0fc91ea0c3c078 (diff)
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.rb9
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