当前位置: 首页>>代码示例>>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;未经允许,请勿转载。