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

Description

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.

 
$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
              )));
      else:
             $log->addWriter(new Zend_Log_Writer_Null());
      endif;
          //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);    

Comments

I think you make a mistake:


$columnMapping = array('lvl' => 'LVL', 'msg' => 'MSG');

must be replace by


$columnMapping = array('LVL' => 'priority', 'MSG' => 'message');

even with that change, it dosen't work.

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