Skip to content

Commit

Permalink
Update README.md to use log_level env var
Browse files Browse the repository at this point in the history
  • Loading branch information
reidmorrison authored Jun 28, 2024
1 parent 5b48391 commit 114f914
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -18,11 +18,12 @@ For example, adding these lines to `config/application.rb` and removing any othe
# Setup structured logging
config.semantic_logger.application = "my_application"
config.semantic_logger.environment = ENV["STACK_NAME"] || Rails.env
config.log_level = ENV["LOG_LEVEL"] || :info

# Switch to JSON Logging output to stdout when running on Kubernetes
if ENV["LOG_TO_CONSOLE"] || ENV["KUBERNETES_SERVICE_HOST"]
config.rails_semantic_logger.add_file_appender = false
config.semantic_logger.add_appender(io: $stdout, level: ENV["LOG_LEVEL"] || config.log_level, formatter: :json)
config.semantic_logger.add_appender(io: $stdout, formatter: :json)
end
~~~

0 comments on commit 114f914

Please sign in to comment.