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
Posted by Mickael Perraud (mikaelkael) on 2008-09-08T13:10:10.000+0000
I think you make a mistake:
must be replace by
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