What is best practices to log the doctrine queries with monolog? I started with symfony a week ago.
1 Answer
In your configuration, set the doctrine.dbal.logging to true.
# app/config/config.yml
doctrine:
dbal:
driver: pdo_mysql
# ...
logging: true
In fact, queries are logged by default in dev environment by setting the value through the kernel.debug parameter, e.g. logging: %kernel.debug%.