diff --git a/application/Bootstrap.php b/application/Bootstrap.php index 2c5185a02..790e49f29 100644 --- a/application/Bootstrap.php +++ b/application/Bootstrap.php @@ -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 */