Ejemplo n.º 1
0
 public function testLogger()
 {
     Logger::init(__DIR__, 'wisphp');
     for ($i = 0; $i < 4; $i++) {
         Logger::warn(str_repeat($i, 1024));
     }
     //        Logger::flush();
 }
Ejemplo n.º 2
0
 /**
  * Initialize log
  */
 public function initLog()
 {
     $logFile = Conf::get('wisphp.log.file', 'Wisphp');
     $logLevel = Conf::get('wisphp.log.level', $this->debug ? Logger::LOG_LEVEL_DEBUG : Logger::LOG_LEVEL_TRACE);
     if ($this->debug === true) {
         // set log level as debug if in debug mode
         $logLevel = Logger::LOG_LEVEL_DEBUG;
     }
     $roll = Conf::get('wisphp.log.roll', Logger::NONE_ROLLING);
     Logger::init(defined('LOG_ROOT') ? LOG_ROOT : $this->getDir('log'), $logFile, array(), $logLevel, $roll);
     $basic = ['appid' => $this->appId];
     Logger::addBasic($basic);
 }