diff --git a/config/environments/development.rb b/config/environments/development.rb index 3ec137a12a..20310726cb 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -9,9 +9,6 @@ Openfoodnetwork::Application.configure do # :file_store is used by default when no cache store is specifically configured. # config.cache_store = :file_store - # Enable cache instrumentation, which is disabled by default - ActiveSupport::Cache::Store.instrument = true - # Log error messages when you accidentally call methods on nil. config.whiny_nils = true @@ -45,4 +42,6 @@ Openfoodnetwork::Application.configure do # Show emails using Letter Opener config.action_mailer.delivery_method = :letter_opener config.action_mailer.default_url_options = { host: "0.0.0.0:3000" } + + config.log_level = :debug end diff --git a/config/environments/staging.rb b/config/environments/staging.rb index 0595e49495..b0e1b96301 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -42,9 +42,6 @@ Openfoodnetwork::Application.configure do # Use a different cache store in production config.cache_store = :dalli_store - # Enable cache instrumentation, which is disabled by default - ActiveSupport::Cache::Store.instrument = true - # Enable serving of images, stylesheets, and JavaScripts from an asset server # config.action_controller.asset_host = "http://assets.example.com" diff --git a/config/initializers/cache_store.rb b/config/initializers/cache_store.rb new file mode 100644 index 0000000000..009ebbaab6 --- /dev/null +++ b/config/initializers/cache_store.rb @@ -0,0 +1,7 @@ +unless Rails.env.production? + # Enable cache instrumentation, which is disabled by default + ActiveSupport::Cache::Store.instrument = true + + # Log message in the same default logger + ActiveSupport::Cache::Store.logger = Rails.logger +end