title: How to use Eloquent ORM's getQueryLog() outside of Laravel?
body: <p>I've been trying to figure out a way to log SQL queries from Eloquent ORM which I'm using within Zend Framework 1. I came across getQueryLog() method called in this manner:</p>
  
  <pre><code>$queries = DB::getQueryLog();
  </code></pre>
  
  <p>I found Illuminate\Database\Connection to contain the getQueryLog() method so I tried to do the following:</p>
  
  <pre><code>use Illuminate\Database\Connection as DB;
  
  class IndexController
  {
      .
      .
      .
      public function indexAction()
      {
          // do stuff (e.g. fetch/update/create rows) 
          $questions = Questions::all()
          .
          .
          $queries = DB::getQueryLog();
          var_dump($queries); exit;
          .
          // render view
      }
  }
  </code></pre>
  
  <p>However, I get the following notice, and it returns NULL: <code>Notice: Undefined property: IndexController::$queryLog in /var/www/qasystem/vendor/illuminate/database/Illuminate/Database/Connection.php on line 918
  NULL</code></p>
  
  <p>Can someone please suggest how I might use this outside of Laravel? I've searched online and can't see anything that I need to do different, although I suspect most examples will be used within Laravel. Also, is Illuminate\Database\Connection the correct class? Thanks</p>