コード例 #1
0
ファイル: Writer.php プロジェクト: chekun/laravel4sae
 public function useDailyFiles($path, $days = 0, $level = 'debug')
 {
     if (Config::get('app.sae')) {
         return $this->useSaeLog($level);
     }
     parent::useDailyFiles($path, $days, $level);
 }
コード例 #2
0
 /**
  * Configures log writer for logging to files separately from the application.
  *
  * @param Writer $writer
  */
 protected function configureSeparateWriter(Writer $writer)
 {
     $path = 'logs/' . ltrim($this->getCore()->config('log.file', 'cms'), '/');
     if ($this->getCore()->config('log.daily')) {
         $writer->useDailyFiles(storage_path($path), (int) $this->getCore()->config('log.max_files'));
     }
     foreach ($writer->getMonolog()->getHandlers() as $handler) {
         $handler->setLevel($this->getCore()->config('log.threshold'));
     }
 }
コード例 #3
0
 /**
  * Bootstrap the given application.
  *
  * @param  \Illuminate\Contracts\Foundation\Application  $app
  * @return void
  */
 public function bootstrap(Application $app)
 {
     $logger = new Writer(new Monolog($app->environment()), $app['events']);
     // Daily files are better for production stuff
     $logger->useDailyFiles(storage_path('/logs/laravel.log'));
     $app->instance('log', $logger);
     // Next we will bind the a Closure to resolve the PSR logger implementation
     // as this will grant us the ability to be interoperable with many other
     // libraries which are able to utilize the PSR standardized interface.
     $app->bind('Psr\\Log\\LoggerInterface', function ($app) {
         return $app['log']->getMonolog();
     });
     $app->bind('Illuminate\\Contracts\\Logging\\Log', function ($app) {
         return $app['log'];
     });
 }
コード例 #4
0
ファイル: _ide_helper.php プロジェクト: satriashp/tour
 /**
  * Register a daily file log handler.
  *
  * @param string $path
  * @param int $days
  * @param string $level
  * @return void 
  * @static 
  */
 public static function useDailyFiles($path, $days = 0, $level = 'debug')
 {
     \Illuminate\Log\Writer::useDailyFiles($path, $days, $level);
 }
コード例 #5
0
ファイル: ConfigureLogging.php プロジェクト: sapwoo/portfolio
 /**
  * Configure the Monolog handlers for the application.
  *
  * @param \Illuminate\Contracts\Foundation\Application $app        	
  * @param \Illuminate\Log\Writer $log        	
  * @return void
  */
 protected function configureDailyHandler(Application $app, Writer $log)
 {
     $log->useDailyFiles($app->storagePath() . '/logs/laravel.log', $app->make('config')->get('app.log_max_files', 5));
 }
コード例 #6
0
ファイル: ConfigureLogging.php プロジェクト: notadd/framework
 /**
  * @param \Illuminate\Contracts\Foundation\Application|\Notadd\Foundation\Application $app
  * @param \Illuminate\Log\Writer                                                      $log
  *
  * @return void
  */
 protected function configureDailyHandler(Application $app, Writer $log)
 {
     $config = $app->make('config');
     $maxFiles = $config->get('app.log_max_files');
     $log->useDailyFiles($app->storagePath() . '/logs/laravel.log', is_null($maxFiles) ? 5 : $maxFiles, $config->get('app.log_level', 'debug'));
 }
コード例 #7
0
 /**
  * Configure the Monolog handlers for the application.
  *
  * @param  \Illuminate\Contracts\Foundation\Application  $app
  * @param  \Illuminate\Log\Writer  $log
  * @return void
  */
 protected function configureDailyHandler(Application $app, Writer $log)
 {
     $log->useDailyFiles($app->storagePath() . '/logs/laravel.log', 5);
 }
コード例 #8
0
 /**
  * Configure the Monolog handlers for the application.
  *
  * @param  \Illuminate\Contracts\Foundation\Application $app
  * @param  \Illuminate\Log\Writer                       $log
  *
  * @return void
  */
 protected function configureDailyHandler(Application $app, Writer $log)
 {
     $log->useDailyFiles(storage_path('logs/laravel.log'), config('app.log_max_files', 5));
 }
コード例 #9
0
 /**
  * Configure the Monolog handlers for the application.
  *
  * @param  \Illuminate\Contracts\Foundation\Application $app
  * @param  \Illuminate\Log\Writer                       $log
  * @return void
  */
 protected function configureDailyHandler(Application $app, Writer $log)
 {
     $fileName = php_sapi_name();
     $log->useDailyFiles($app->storagePath() . '/logs/' . $fileName . '.log', $app->make('config')->get('app.log_max_files', 5));
 }
コード例 #10
0
 /**
  * Configure the Monolog handlers for the application.
  *
  * @param  \Illuminate\Log\Writer  $log
  * @return void
  */
 protected function configureDailyHandler(Writer $log)
 {
     $log->useDailyFiles($this->app->storagePath() . '/logs/laravel.log', $this->maxFiles(), $this->logLevel());
 }