Skip to content

Commit

Permalink
Use a JSON object for log tags, not an array
Browse files Browse the repository at this point in the history
  • Loading branch information
ollietreend committed Mar 27, 2024
1 parent 6b0aa39 commit d53b34e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion config/initializers/semantic_logger.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
if Rails.env.development? || Rails.env.production?
Rails.application.configure do
config.log_tags = [:request_id] # Prepend all log lines with the following tags
# Prepend all log lines with the following tags
config.log_tags = {
request_id: :request_id,
some_other_tag: "some other value",
}
end

SemanticLogger.add_appender(io: $stdout, level: Rails.application.config.log_level, formatter: Rails.application.config.log_format)
Expand Down

0 comments on commit d53b34e

Please sign in to comment.