예제 #1
0
//
//  Logger initialization
//
//------------------------------------------------------------------------------
/*! Note @ 7 Aug, 2015
 *  Here we started to make use of the Psr\Log interface and Seldaek\Monolog,
 *  digging the original Log class empty as a wrapper to LoggerInterface, and
 *  moved the backtrace and session info into separate processors in monolog.
 *
 *  Specifically, backtrace context like file, subject and action are moved to
 *  the BacktraceProcessor class, while session info is moved to the
 *  SessionProcessor class.
 *
 *  Node::set() invoke is migrated into NodeHandler class.
 */
Log::setLogger(new Logger('default'));
// Log enabled
if (conf::get('system::log.enabled', true)) {
    $level = Logger::toMonologLevel(conf::get('system::log.level', 'debug'));
    Log::getLogger()->pushProcessor(new BacktraceProcessor($level))->pushProcessor(new SessionProcessor($level))->pushProcessor(new ProcessProcessor($level))->pushHandler(new NodeHandler($level));
    unset($level);
} else {
    // This should not be necessary, no handlers will run nothing.
    Log::getLogger()->pushHandler(new NullHandler());
}
//------------------------------------------------------------------------------
//
//  System shims
//
//------------------------------------------------------------------------------
require_once __DIR__ . '/framework/environment.php';