Exemple #1
0
 public function __invoke(ContainerInterface $container)
 {
     $config = $container->get('config');
     $losConfig = array_key_exists('loslog', $config) ? $config['loslog'] : [];
     $logDir = array_key_exists('log_dir', $losConfig) ? $losConfig['log_dir'] : 'data/logs';
     $logFile = array_key_exists('http_logger_file', $losConfig) ? $losConfig['http_logger_file'] : 'http.log';
     $logger = AbstractLogger::generateFileLogger($logFile, $logDir);
     return new HttpLog($logger, $losConfig);
 }
Exemple #2
0
 /**
  * Registers the handlers for errors and exceptions.
  *
  * @param string $logFile
  * @param string $logDir
  */
 public static function registerHandlers($logFile = 'error.log', $logDir = 'data/logs', $continue = true)
 {
     $logger = AbstractLogger::generateFileLogger($logFile, $logDir);
     Logger::registerErrorHandler($logger->getLogger(), $continue);
     Logger::registerFatalErrorShutdownFunction($logger->getLogger());
 }
 /**
  * Registers the handlers for errors and exceptions.
  *
  * @param string $logFile
  * @param string $logDir
  */
 public static function registerHandlers($logFile = 'exception.log', $logDir = 'data/logs')
 {
     $logger = AbstractLogger::generateFileLogger($logFile, $logDir);
     Logger::registerExceptionHandler($logger->getLogger());
 }