Skip to content

Commit

Permalink
Merge pull request #2235 from DFE-Digital/fix-logs
Browse files Browse the repository at this point in the history
Set Rails Semantic Logger format to JSON
  • Loading branch information
thomasleese authored May 31, 2024
2 parents 62865e1 + 17bde92 commit 9d6e275
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,5 @@
config.logger =
ActiveSupport::Logger.new(config.paths["log"].first, 1, 50.megabytes)

config.log_format = :color
config.semantic_logger.backtrace_level = :debug
end
4 changes: 2 additions & 2 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
# Include generic and useful information about system operation, but avoid logging too much
# information to avoid inadvertent exposure of personally identifiable information (PII).
config.log_level = :info
config.log_format = :json

# Prepend all log lines with the following tags.
config.log_tags = [:request_id]
Expand Down Expand Up @@ -82,7 +81,8 @@
config.rails_semantic_logger.add_file_appender = false
config.semantic_logger.add_appender(
io: $stdout,
formatter: config.rails_semantic_logger.format,
level: config.log_level,
formatter: :json,
)
end

Expand Down

0 comments on commit 9d6e275

Please sign in to comment.