Skip to content

Commit 759f2cb

Browse files
authored
Container logging already has built-in timestamps (rails#52993)
It just makes the logs more unreadable when you have them doubled up by default.
1 parent c415502 commit 759f2cb

File tree

1 file changed

+2
-6
lines changed
  • railties/lib/rails/generators/rails/app/templates/config/environments

1 file changed

+2
-6
lines changed

railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,9 @@ Rails.application.configure do
5353
# Prevent health checks from clogging up the logs.
5454
config.silence_healthcheck_path = "/up"
5555

56-
# Log to STDOUT by default.
57-
config.logger = ActiveSupport::Logger.new(STDOUT)
58-
.tap { |logger| logger.formatter = ::Logger::Formatter.new }
59-
.then { |logger| ActiveSupport::TaggedLogging.new(logger) }
60-
61-
# Prepend all log lines with the following tags.
56+
# Log to STDOUT with the current request id as a default log tag.
6257
config.log_tags = [ :request_id ]
58+
config.logger = ActiveSupport::TaggedLogging.new(ActiveSupport::Logger.new(STDOUT))
6359

6460
# "info" includes generic and useful information about system operation, but avoids logging too much
6561
# information to avoid inadvertent exposure of personally identifiable information (PII). If you

0 commit comments

Comments
 (0)