예제 #1
0
 public function __construct()
 {
     // construct a composite logger, from which any number of loggers can be
     // attached
     parent::__construct('composite');
     // if debug on, log DEBUG messages, else use INFO as default
     $debug = (bool) Zend_Registry::get('config')->application->debug->enabled;
     $loglevel = $debug || $_GET['debug'] ? PEAR_LOG_DEBUG : PEAR_LOG_INFO;
     $this->_loglevel = Log::MAX($loglevel);
     $logfile = APP_ROOT . "/artifacts/logs/" . basename(APP_ROOT) . "_out.log";
     ini_set('error_log', $logfile);
     // by default, log messages will always be logged to a default log file
     $logger = new Log_file($logfile);
     $logger->setMask($this->_loglevel);
     $this->addChild($logger);
     // now, check if user wants logging via GET params
     $this->attachPopup();
     $this->attachLogFile();
     $this->enableXdebug();
     // define a new log level for profiling
     define('PEAR_LOG_PROFILE', PEAR_LOG_DEBUG + 1);
     // now, check if user wants profiling
     $this->attachProfiler();
 }
예제 #2
0
 public function __construct($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG)
 {
     parent::__construct($name, $ident, $conf, $level);
     $this->consoleLog = new ChefLogConsole('ChefConsole');
     $this->addChild($this->consoleLog);
 }