mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-20 04:59:16 +00:00
Enable verbose query logs in development
This is a new feature in Rails 7. Whenever a query is triggered it not only show you the query (as before), but also tells you (directly in the logs) exactly which line of code was responsible for triggering the query. It's unbelievably useful for debugging and performance work.
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
#
|
||||
# cp .env.development .env.local
|
||||
|
||||
VERBOSE_QUERY_LOGS=true
|
||||
|
||||
SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
|
||||
OFN_REDIS_URL="redis://localhost:6379/1"
|
||||
|
||||
@@ -221,6 +221,9 @@ module Openfoodnetwork
|
||||
config.assets.precompile += ['shared/*']
|
||||
config.assets.precompile += ['*.jpg', '*.jpeg', '*.png', '*.gif' '*.svg']
|
||||
|
||||
# Highlight code that triggered database queries in logs.
|
||||
config.active_record.verbose_query_logs = ENV.fetch("VERBOSE_QUERY_LOGS", false)
|
||||
|
||||
# Apply framework defaults. New recommended defaults are successively added with each Rails version and
|
||||
# include the defaults from previous versions. For more info see:
|
||||
# https://guides.rubyonrails.org/configuring.html#results-of-config-load-defaults
|
||||
|
||||
Reference in New Issue
Block a user