当前位置: 首页>>代码示例>>PHP>>正文


PHP Log::getMonolog方法代码示例

本文整理汇总了PHP中Illuminate\Support\Facades\Log::getMonolog方法的典型用法代码示例。如果您正苦于以下问题:PHP Log::getMonolog方法的具体用法?PHP Log::getMonolog怎么用?PHP Log::getMonolog使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Support\Facades\Log的用法示例。


在下文中一共展示了Log::getMonolog方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * LogService constructor.
  *
  * @param $monolog
  */
 public function __construct()
 {
     $this->monolog = Log::getMonolog();
     $this->path = storage_path() . '/logs/';
     $this->type = Logger::INFO;
     $this->file = "laravel.log";
 }
开发者ID:xavierauana,项目名称:events,代码行数:12,代码来源:LogService.php

示例2: boot

 /**
  * Send logs from the given level to Pushbullet.
  *
  * @return void
  */
 public function boot()
 {
     parent::boot();
     if (in_array(config('app.env'), (array) config('services.monobullet.env', config('app.env')))) {
         $monolog = Log::getMonolog();
         $monolog->pushHandler(new PushbulletHandler(config('services.monobullet.token'), config('services.monobullet.recipients'), config('services.monobullet.level', Logger::INFO), config('services.monobullet.propagate', true)));
     }
 }
开发者ID:max13,项目名称:monobullet,代码行数:13,代码来源:MonobulletServiceProvider.php

示例3: getEnvironmentSetUp

 /**
  * Define environment setup.
  *
  * @param  Illuminate\Foundation\Application $app
  * @return void
  */
 protected function getEnvironmentSetUp($app)
 {
     // reset base path to point to our package's src directory
     $app['path.base'] = __DIR__ . '/../../';
     $app['config']->set('app.debug', false);
     // Here we disable any log output to the console, which makes reading any test
     // errors/information easier to read and understand during test runs.
     $monolog = Log::getMonolog();
     $monolog->pushHandler(new NullHandler());
     // Necessary for future checks
     Config::set('shift.languages', ['en_GB' => 'English (Great Britain)']);
 }
开发者ID:kamaroly,项目名称:shift,代码行数:18,代码来源:TestCase.php

示例4: bootWhenLocal

 protected function bootWhenLocal()
 {
     //开发环境
     if (!$this->app->isLocal()) {
         return;
     }
     //日志
     $logger = Log::getMonolog();
     $logger->pushHandler(new BrowserConsoleHandler());
     //DB事件
     DB::listen(function ($query) {
         Log::info('sql :' . $query->sql, ['binding' => $query->bindings, 'time' => $query->time]);
     });
 }
开发者ID:thirdgerb,项目名称:commune-framework,代码行数:14,代码来源:AppServiceProvider.php

示例5: boot

 /**
  * Boot the service provider.
  *
  * @return void
  *
  * @author Wuhsien Yu <wuhsienyu@gmail.com>
  *
  * @since  2016/03/10
  */
 public function boot()
 {
     $monolog = Log::getMonolog();
     $LogLevel = Logger::toMonologLevel(self::getLevel());
     foreach (Logger::getLevels() as $level) {
         if ($LogLevel <= $level) {
             $logHandler = new StreamHandler(self::getPath($level), $level, false);
             $logHandler->setFormatter(self::getFormat());
         } else {
             $logHandler = new NullHandler($level);
         }
         $monolog->pushHandler($logHandler);
     }
     $this->publishes([__DIR__ . '/../config/log.php' => config_path('log.php')]);
 }
开发者ID:wuhsien,项目名称:log-level,代码行数:24,代码来源:LogLevelServiceProvider.php

示例6: register

 /**
  * Register the application services.
  *
  * @return void
  */
 public function register()
 {
     $this->app->singleton('tevo', function () {
         // Setup Logger
         $log = Log::getMonolog();
         $log->pushHandler(new RotatingFileHandler(storage_path('logs/tevo-api-client-log.txt'), 0, constant('\\Monolog\\Logger::' . env('TEVO_API_CLIENT_LOG_LEVEL', 'INFO'))));
         if (env('TEVO_API_CLIENT_LOG_LEVEL') === 'DEBUG') {
             $subscriberLogLevel = 'DEBUG';
         } else {
             $subscriberLogLevel = 'CLF';
         }
         $logSubscriber = new LogSubscriber($log, constant('\\GuzzleHttp\\Subscriber\\Log\\Formatter::' . $subscriberLogLevel));
         $apiClient = new Client(config('ticketevolution'));
         $apiClient->getEmitter()->attach($logSubscriber);
         return $apiClient;
     });
     $this->app->alias('Tevo', self::class);
 }
开发者ID:jwcobb,项目名称:tevo-harvester,代码行数:23,代码来源:TevoApiServiceProvider.php

示例7: getLogKayitlari

 public function getLogKayitlari()
 {
     $monolog = Log::getMonolog();
     return view('yonetim.logkayitlari', compact('monolog'));
 }
开发者ID:anarschi,项目名称:baslangic,代码行数:5,代码来源:AdminController.php

示例8: getLogger

 /**
  * @return LoggerInterface
  */
 public function getLogger()
 {
     return $this->logger ?: ($this->logger = Log::getMonolog());
 }
开发者ID:rajeshpillai,项目名称:dfe-common,代码行数:7,代码来源:Lumberjack.php

示例9: getLogPlugin

 /**
  * Get the log plugin.
  *
  * @return LogPlugin
  */
 public static function getLogPlugin()
 {
     $adapter = new MonologLogAdapter(Log::getMonolog());
     $format = "[{ts}] \"{method} {resource} {protocol}/{version}\" {code} {phrase} time:{total_time} kinveyRID:{res_header_x-kinvey-request-id} request:{req_body}";
     $formatter = new MessageFormatter($format);
     return new LogPlugin($adapter, $formatter);
 }
开发者ID:tvpsoft,项目名称:laravel-kinvey,代码行数:12,代码来源:KinveyClient.php

示例10: __construct

 /**
  * Constructor
  *
  * @param Application $app
  */
 public function __construct($app = null)
 {
     $this->app = $app;
     $this->initializeLumberjack(Log::getMonolog());
     $this->boot();
 }
开发者ID:rajeshpillai,项目名称:dfe-common,代码行数:11,代码来源:BaseService.php


注:本文中的Illuminate\Support\Facades\Log::getMonolog方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。