Added logging level manipulation mechanism

This commit is contained in:
Pavel Pivovarov
2019-07-10 00:35:34 +00:00
parent 49755a4c88
commit f03ed5c087
2 changed files with 8 additions and 2 deletions

View File

@@ -37,4 +37,10 @@ _Default_: `/app/db/database/snibox.sqlite3`
--- ---
`SECRET_KEY_BASE` - Defines `secret_key_base` parameter for your Rails application. Default one is included into the image already, but general recommendation is to change it. `SECRET_KEY_BASE` - Defines `secret_key_base` parameter for your Rails application. Default one is included into the image already, but general recommendation is to change it.
---
`LOGLEVEL` - Defines logging level for Rails application. Available options are: `debug`, `info`, `warn`, `error` and `fatal`
_Default_: `debug`

View File

@@ -29,7 +29,7 @@ module Snibox
logger = ActiveSupport::Logger.new(STDOUT) logger = ActiveSupport::Logger.new(STDOUT)
logger.formatter = config.log_formatter logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger) config.logger = ActiveSupport::TaggedLogging.new(logger)
config.log_level = :debug config.log_level = (ENV['LOGLEVEL'] || "debug").to_sym
config.log_tags = [ :request_id ] config.log_tags = [ :request_id ]
# Settings in config/environments/* take precedence over those specified here. # Settings in config/environments/* take precedence over those specified here.