Monolog in registry
This commit is contained in:
parent
f19057dcca
commit
af0d432680
@ -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
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user