title: Override write function of CakePHP log
body: <p>I'm try <strong>save CakePHP logs in database</strong> (table: logs), but return error when I try:</p>
  <pre><code>Could not load class Databaselogger
  Error: An Internal Error Has Occurred.
  
  Stack Trace
  CORE\Cake\Log\LogEngineCollection.php line 42 → LogEngineCollection::_getLogger(string)
  CORE\Cake\Log\CakeLog.php line 199 → LogEngineCollection-&gt;load(string, array)
  APP\Config\bootstrap.php line 31 → CakeLog::config(string, array)
  CORE\Cake\Core\Configure.php line 93 → include(string)
  CORE\Cake\bootstrap.php line 164 → Configure::bootstrap(boolean)
  APP\webroot\index.php line 91 → include(string)
  </code></pre>
  <hr />
  <h1>DETAILS<br /></h1>
  <p><strong>CakePHP:</strong> 2.3<br />
  <strong>Apache:</strong> 2.2<br />
  <strong>PHP:</strong> 5.3.9<br />
  <strong>MySQL:</strong> 5.1<br /><br /></p>
  <h2>FILES</h2>
  <p><strong>bootstrap.php</strong><br /></p>
  <pre><code>CakeLog::config('otherFile', array(
      'engine' =&gt; 'Databaselogger'
  ));
  </code></pre>
  <p><strong>UsersController.php</strong><br /></p>
  <pre><code>CakeLog::write('info', $this-&gt;alias, null, print_r($this-&gt;request-&gt;data, true));
  </code></pre>
  <p><strong>app/Log/Databaselogger.php</strong><br />
  <em>I try in app/Lib/ too, and app/Lib/log too</em> but doesn't work.<br /></p>
  <pre><code>&lt;?php
  class Databaselogger extends CakeLog {
   
      function __construct() {
          App::import('Model', 'Log');
          $this-&gt;Log = new Log;
      }
   
      function write($type, $message, $query, $debug) {
          $this-&gt;Log-&gt;create();
          
          $log['type'] = ucfirst($type);
          $log['message'] = $message;
          $log['query'] = $query;
          $log['debug'] = $debug;
          $log['created'] = date('Y-m-d H:i:s');
          $log['modified'] = date('Y-m-d H:i:s');
   
          return $this-&gt;Log-&gt;save($log);
      }
   
  }
  ?&gt;
  </code></pre>
  <hr />
  <p><strong>[EDIT]</strong><br />
  I change the location of <code>DatabaseLogger.php</code> file, and add 2 important lines:</p>
  <pre><code>    // app/Lib/Log/Engine/DatabaseLogger.php
  
      App::uses('CakeLogInterface', 'Log');
      class DatabaseLogger implements CakeLogInterface {
  </code></pre>
  <p>And now, &quot;works&quot;, but not as I expected, because I need more 2 values in write function: <code>query, debug</code>, but isn't allowed. How I do that?</p>
  <pre><code>    function write($type, $message, $query, $debug) {
  </code></pre>