Created
January 24, 2014 09:28
-
-
Save tonydub/8594461 to your computer and use it in GitHub Desktop.
How to display sql queries with monolog and doctrine channel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$logger = $this->getContainer()->get('monolog.logger.doctrine'); | |
foreach ($logger->getLogs() as $log) { | |
$output->writeln(sprintf('<info>Query:</info> %s (%s)', $log['message'], json_encode($log['context']))); | |
$output->writeln(''); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment