I have a weird issue, when I checked my app/log/dev.log
I can see almost all of my queries in my dev.log
being logged in real time:
I encountered a similar issue with dev.log
being generated on prod
environment. I figured out from the log entries that what was causing my issue was a scheduled cron job calling a custom symfony command. Modifying the entry to app/console
with --env=prod
for my crontab since stopped dev.log
being generated. i.e.
app/console --env=prod custom:command
Must have missed that section of the book :)
You should use prod
env on your production server. In the prod
env doctrine's logging is disabled by default.
But if you want to disable logging at all (in all environments) you need to set up a config.yml
like that:
doctrine:
dbal:
connections:
conn1:
driver: ...
...
logging: false
profiling: false
Reference: https://symfony.com/doc/current/bundles/DoctrineBundle/configuration.html