environment() public method

Get or check the current application environment.
public environment ( ) : string
return string
示例#1
0
 /**
  * @param Application $app
  */
 protected function registerLogger(Application $app)
 {
     $logger = new Logger($app->environment());
     $logPath = $app->storagePath() . '/logs/flarum.log';
     $handler = new StreamHandler($logPath, Logger::DEBUG);
     $handler->setFormatter(new LineFormatter(null, null, true, true));
     $logger->pushHandler($handler);
     $app->instance('log', $logger);
     $app->alias('log', 'Psr\\Log\\LoggerInterface');
 }