Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save tonydub/8594461 to your computer and use it in GitHub Desktop.

Select an option

Save tonydub/8594461 to your computer and use it in GitHub Desktop.

Revisions

  1. tonydub created this gist Jan 24, 2014.
    6 changes: 6 additions & 0 deletions display_sql_with_monolog_and_channel_doctrine.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    <?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('');
    }