當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Writer::getMonolog方法代碼示例

本文整理匯總了PHP中Illuminate\Log\Writer::getMonolog方法的典型用法代碼示例。如果您正苦於以下問題:PHP Writer::getMonolog方法的具體用法?PHP Writer::getMonolog怎麽用?PHP Writer::getMonolog使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Log\Writer的用法示例。


在下文中一共展示了Writer::getMonolog方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure                 $next
  *
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $correlationalId = $request->attributes->get(CorrelationalId::HEADER);
     $this->logger->getMonolog()->pushProcessor(function ($record) use($correlationalId) {
         $record['extra'][self::LOG_KEY] = $correlationalId;
         return $record;
     });
     /** @var Response $response */
     $response = $next($request);
     return $response;
 }
開發者ID:devitek,項目名稱:laravel-correlational-id,代碼行數:19,代碼來源:CorrelationalIdMonolog.php

示例2: configureHandlers

 /**
  * Custom Monolog handler that for Logentries.
  *
  * @param  \Illuminate\Contracts\Foundation\Application  $app
  * @param  \Illuminate\Log\Writer  $log
  * @return void
  */
 protected function configureHandlers(Application $app, Writer $log)
 {
     $logger = $log->getMonolog();
     $logfile_handler = new StreamHandler(storage_path() . '/logs/laravel.log');
     $logger->pushHandler($logfile_handler);
     $logger->pushProcessor(new \Monolog\Processor\MemoryUsageProcessor());
     $logger->pushProcessor(new \Monolog\Processor\MemoryPeakUsageProcessor());
     $logger->pushProcessor(new \Monolog\Processor\WebProcessor());
 }
開發者ID:ambarsetyawan,項目名稱:brewski,代碼行數:16,代碼來源:ConfigureLogging.php

示例3: configureSeparateWriter

 /**
  * 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'));
     }
 }
開發者ID:czim,項目名稱:laravel-cms-core,代碼行數:15,代碼來源:LogServiceProvider.php

示例4: configureHandlers

 /**
  * Configure the Monolog handlers for the application.
  *
  * @param  \Illuminate\Contracts\Foundation\Application  $app
  * @param  \Illuminate\Log\Writer  $log
  * @return void
  */
 protected function configureHandlers(Application $app, Writer $log)
 {
     // Stream handlers
     $logPath = $app->storagePath() . '/logs/app.log';
     $logLevel = Monolog::INFO;
     $logStreamHandler = new StreamHandler($logPath, $logLevel);
     // push handlers
     $logger = $log->getMonolog();
     $logger->pushHandler($logStreamHandler);
 }
開發者ID:Kenneth058,項目名稱:adminclubinnova,代碼行數:17,代碼來源:ConfigureLogging.php

示例5: createLogger

 /**
  * Create the logger.
  *
  * @return \Illuminate\Log\Writer
  */
 public function createLogger()
 {
     $log = new Writer(new Monolog($this->app->bound('env') ? $this->app->environment() : 'production'), $this->app['events']);
     if ($this->app->hasMonologConfigurator()) {
         call_user_func($this->app->getMonologConfigurator(), $log->getMonolog());
     } else {
         $this->configureHandlers($log);
     }
     return $log;
 }
開發者ID:bryanashley,項目名稱:framework,代碼行數:15,代碼來源:LogServiceProvider.php

示例6: configureSingleHandler

 /**
  * Configure the Monolog handlers for the application.
  *
  * @param  \Illuminate\Contracts\Foundation\Application  $app
  * @param  \Illuminate\Log\Writer  $log
  * @return void
  */
 protected function configureSingleHandler(Application $app, Writer $log)
 {
     $syslogHandler = new SyslogHandler(env('LOG_PREFIX', 'BasketLog'), LOG_USER, LOG_NOTICE);
     $logger = $log->getMonolog();
     if (env('LOG_SYSLOG', false)) {
         $logger->pushHandler($syslogHandler);
     }
     if (env('LOG_FILE', false)) {
         $streamHandler = new StreamHandler(storage_path('logs/laravel.log'), LOG_NOTICE);
         $logger->pushHandler($streamHandler);
     }
 }
開發者ID:paybreak,項目名稱:basket,代碼行數:19,代碼來源:ConfigureLogging.php

示例7: getMonolog

 /**
  * Get the underlying Monolog instance.
  *
  * @return \Monolog\Logger 
  * @static 
  */
 public static function getMonolog()
 {
     return \Illuminate\Log\Writer::getMonolog();
 }
開發者ID:satriashp,項目名稱:tour,代碼行數:10,代碼來源:_ide_helper.php

示例8: __construct

 /**
  * SendUpdateAvailableNotification constructor.
  *
  * @param Writer $logger
  * @param Mailer $mailer
  */
 public function __construct(Writer $logger, Mailer $mailer)
 {
     $this->logger = $logger->getMonolog();
     $this->mailer = $mailer;
 }
開發者ID:codedge,項目名稱:laravel-selfupdater,代碼行數:11,代碼來源:SendUpdateAvailableNotification.php

示例9: configureHandlers

 /**
  * OVERRIDE PARENT
  * Configure the Monolog handlers for the application.
  *
  * @param  \Illuminate\Contracts\Foundation\Application  $app
  * @param  \Illuminate\Log\Writer  $log
  * @return void
  */
 protected function configureHandlers(Application $app, Writer $log)
 {
     $log->getMonolog()->pushHandler(new ErrorLogHandler());
 }
開發者ID:npmweb,項目名稱:laravel-heroku,代碼行數:12,代碼來源:ConfigureLogging.php

示例10: configureSeparateHandler

 protected function configureSeparateHandler(Application $app, Writer $log)
 {
     $log->getMonolog()->pushHandler($handler = new SeparateFileHandler("dummy"));
     $handler->setFormatter(new LineFormatter(null, null, true, true));
 }
開發者ID:skvn,項目名稱:laraext,代碼行數:5,代碼來源:ConfigureLogging.php


注:本文中的Illuminate\Log\Writer::getMonolog方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。