diff --git a/config/application.yml.default b/config/application.yml.default index 4facf7172..6d4a3e275 100644 --- a/config/application.yml.default +++ b/config/application.yml.default @@ -51,3 +51,5 @@ UIB_DATE_FORMAT: 'dd/MM/yyyy' OPENLAB_APP_SECRET: OPENLAB_APP_ID: OPENLAB_BASE_URI: 'https://openprojects.fab-manager.com' + +LOG_LEVEL: 'debug' diff --git a/config/environments/development.rb b/config/environments/development.rb index 2e1262529..074739368 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -41,4 +41,6 @@ Rails.application.configure do config.action_mailer.delivery_method = :letter_opener config.action_mailer.default_url_options = { :host => 'localhost:5000' } + + config.log_level = Rails.application.secrets.log_level || :debug end diff --git a/config/environments/production.rb b/config/environments/production.rb index c0285ae84..634bd4a48 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -46,7 +46,7 @@ Rails.application.configure do # config.force_ssl = true # Set to :debug to see everything in the log. - config.log_level = :debug + config.log_level = Rails.application.secrets.log_level || :debug # Prepend all log lines with the following tags. # config.log_tags = [ :subdomain, :uuid ] diff --git a/config/environments/staging.rb b/config/environments/staging.rb index 1db32f4e9..71a8ceeb6 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -46,7 +46,7 @@ Rails.application.configure do # config.force_ssl = true # Set to :debug to see everything in the log. - config.log_level = :debug + config.log_level = Rails.application.secrets.log_level || :debug # Prepend all log lines with the following tags. # config.log_tags = [ :subdomain, :uuid ] diff --git a/config/environments/test.rb b/config/environments/test.rb index 224c4f69f..c4634c92c 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -41,4 +41,5 @@ Rails.application.configure do config.active_support.test_order = :random + config.log_level = Rails.application.secrets.log_level || :debug end diff --git a/config/secrets.yml b/config/secrets.yml index 4425cc5fc..1b012b312 100644 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -33,6 +33,7 @@ development: openlab_base_uri: <%= ENV["OPENLAB_BASE_URI"] %> navinum_api_login: <%= ENV["NAVINUM_API_LOGIN"] %> navinum_api_password: <%= ENV["NAVINUM_API_PASSWORD"] %> + log_level: <%= ENV["LOG_LEVEL"] %> test: secret_key_base: 83daf5e7b80d990f037407bab78dff9904aaf3c195a50f84fa8695a22287e707dfbd9524b403b1dcf116ae1d8c06844c3d7ed942564e5b46be6ae3ead93a9d30 @@ -57,6 +58,7 @@ test: openlab_base_uri: navinum_api_login: navinum_api_password: + log_level: <%= ENV["LOG_LEVEL"] %> staging: secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> @@ -88,6 +90,7 @@ staging: openlab_base_uri: <%= ENV["OPENLAB_BASE_URI"] %> navinum_api_login: <%= ENV["NAVINUM_API_LOGIN"] %> navinum_api_password: <%= ENV["NAVINUM_API_PASSWORD"] %> + log_level: <%= ENV["LOG_LEVEL"] %> # Do not keep production secrets in the repository, # instead read values from the environment. @@ -122,3 +125,4 @@ production: google_analytics_id: <%= ENV["GA_ID"] %> navinum_api_login: <%= ENV["NAVINUM_API_LOGIN"] %> navinum_api_password: <%= ENV["NAVINUM_API_PASSWORD"] %> + log_level: <%= ENV["LOG_LEVEL"] %>