ZF-3663: Zend Log does not work with an Oracle Database

Issue Type: Bug Created: 2008-07-17T06:16:12.000+0000 Last Updated: 2008-09-11T14:27:33.000+0000 Status: Resolved Fix version(s): - 1.6.1 (15/Sep/08)

Reporter: Gabriel Baez (gabrielbaez) Assignee: Mickael Perraud (mikaelkael) Tags: - Zend_Log

Related issues: Attachments:


Zend_Log dosen't seem to work for an oracle database at all, but when I switch to mysql or postgresql it works fine. here is the code.

<pre class="highlight"> 
$db = Zend_Registry::get('db');   
        /** Logging * */
      $log = new Zend_Log();
       //Log either to database or file
       if (strcasecmp($config->log->adapter, 'database') == 0) :
             $columnMapping = array('lvl' => 'LVL', 'msg' => 'MSG');
             $log->addWriter(new Zend_Log_Writer_Db($db, 'LOGS', $columnMapping));
          //$log->info('Informational message');
      elseif (strcasecmp($config->log->adapter, 'file') == 0 && $config->log->file):
             $log->addWriter(new Zend_Log_Writer_Stream(realpath(
                   rtrim($config->paths->logs, '/\\') . DIRECTORY_SEPARATOR . $config->log->file
             $log->addWriter(new Zend_Log_Writer_Null());
          //Log priority filter
             $log->addFilter(new Zend_Log_Filter_Priority(
             $config->log->level ? (int) $config->log->level : Zend_Log::WARN));
             Zend_Registry::set('log', $log);    


Posted by Mickael Perraud (mikaelkael) on 2008-09-08T13:10:10.000+0000

I think you make a mistake:

<pre class="highlight">
$columnMapping = array('lvl' => 'LVL', 'msg' => 'MSG');

must be replace by

<pre class="highlight">
$columnMapping = array('LVL' => 'priority', 'MSG' => 'message');

Posted by Gabriel Baez (gabrielbaez) on 2008-09-08T13:48:02.000+0000

even with that change, it dosen't work.

Posted by Mickael Perraud (mikaelkael) on 2008-09-11T14:27:32.000+0000

After exchange of mail, it appears that it is indeed a problem of mapping added with a difference in level of priority in the configuration

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.