Monolog in registry

This commit is contained in:
Michael RICOIS 2017-02-10 16:54:46 +01:00
parent f19057dcca
commit af0d432680

View File

@ -98,6 +98,35 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
Zend_Registry::set('log', $AppLogger);
}
/**
* Logs and Debug
*/
protected function _initLogger()
{
$config = new Zend_Config($this->getOptions());
$logFile = $config->profil->path->shared.'/log/application.log';
$log = new Logger('APP');
// Console Handler
if (in_array(APPLICATION_ENV, array('development', 'staging'))) {
$log->pushHandler(new BrowserConsoleHandler());
}
// File Handler
if (APPLICATION_ENV == 'development') {
$level = Logger::DEBUG;
} else {
$level = Logger::INFO;
}
$log->pushHandler(new StreamHandler($logFile), $level);
// Processor
$log->pushProcessor(new IntrospectionProcessor());
Zend_Registry::set('logger', $log);
}
/**
* Init database
*/