Symfony2 - Doctrine log

doctrine-orm, logging, symfony

Solution

To expand on your answer, especially on dev, I prefer to split each of my log channels so I can easily pipe each to their own output.

In config_dev.yml, add:

monolog:
   handlers:
   [...]
      doctrine:
            action_level: debug
            type:  stream
            path:  %kernel.logs_dir%/%kernel.environment%_doctrine.log
            channels: doctrine

Then

tail -f app/logs/dev_doctrine.log

will give you a nice clean stream of every transaction as it happens. I add one for event, request and security also, but this is all personal preference, naturally.

Problem

I'd like to see all doctrine queries called. I know the dev bar, but it does not show queries processed through Ajax. How can I see all doctrine queries fired ?

Original source