diff options
Diffstat (limited to 'lib/gitlab/json_logger.rb')
-rw-r--r-- | lib/gitlab/json_logger.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/gitlab/json_logger.rb b/lib/gitlab/json_logger.rb index 3a74df8dc8f..d0dcd232ecc 100644 --- a/lib/gitlab/json_logger.rb +++ b/lib/gitlab/json_logger.rb @@ -7,7 +7,7 @@ module Gitlab end def format_message(severity, timestamp, progname, message) - data = {} + data = default_attributes data[:severity] = severity data[:time] = timestamp.utc.iso8601(3) data[Labkit::Correlation::CorrelationId::LOG_KEY] = Labkit::Correlation::CorrelationId.current_id @@ -21,5 +21,11 @@ module Gitlab Gitlab::Json.dump(data) + "\n" end + + protected + + def default_attributes + {} + end end end |