mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
I don't know why but `Rails.logger` is still nil when evaluated from `configure` block in `config/environments/development.rb`. The only way I found to make ActiveSupport's cache to use the default logger is from an initializer. Note that `ActiveSupport::Cache::Store` uses `debug` level and so we need to set the dev logger in that same level to see its messages. If you want to debug in staging as well, you'll need to modify the log level manually.
8 lines
240 B
Ruby
8 lines
240 B
Ruby
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
|