Skip to content

Commit

Permalink
fix: Make the log_level configurable (#461)
Browse files Browse the repository at this point in the history
* fix: Make the log_level configurable

* refactor: Add RAILS_LOG_LEVEL to .env-example

* lint: Fix rubocop offenses
  • Loading branch information
Quentinchampenois authored Jan 4, 2024
1 parent c0793ab commit 7701480
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .env-example
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,6 @@ TRANSLATOR_ENABLED=0
TRANSLATOR_API_KEY=
TRANSLATOR_HOST=
TRANSLATOR_DELAY=0
GALLERY_ANIMATION_ENABLE=0
GALLERY_ANIMATION_ENABLE=0

RAILS_LOG_LEVEL=warn
3 changes: 2 additions & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@

# Use the lowest log level to ensure availability of diagnostic information
# when problems arise.
config.log_level = :info
# The available log levels are: :debug, :info, :warn, :error, :fatal, and :unknown
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "warn").to_sym

# Prepend all log lines with the following tags.
config.log_tags = [:request_id]
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/health_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
config.include_error_in_response_body = false

# Log level (success or failure message with error details is sent to rails log unless this is set to nil)
config.log_level = "info"
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "warn").to_sym

# Timeout in seconds used when checking smtp server
config.smtp_timeout = 30.0
Expand Down

0 comments on commit 7701480

Please sign in to comment.