title: How can I access the Doctrine profiler in production environment?
body: <p>I have a filter set up to count the number of queries executed and write something to my database if they exceed a certain limit.</p>
  
  <p>It works fine in my development environment, but when I test it in my production environment my database doesn't return a profiler anymore. I suposse it is a setting which enables the database profiler for the development environment, but I can' seem to find it.</p>
  
  <p>I use Symfony1.4 and Doctrine.</p>
  
  <pre><code>$database = $databaseManager-&gt;getDatabase($name);
  if ($database instanceof sfDoctrineDatabase &amp;&amp; $profiler = $database-&gt;getProfiler())
  {
      $events = $profiler-&gt;getQueryExecutionEvents();
  }
  </code></pre>