2017 © Pedro Peláez
 

library laravel-log-service

image

lilocon/laravel-log-service

  • Vue
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 1800 % Grown

The README.md

laravel-wechat

阿里云LogService的laravel集成, (*1)

框架要求

Laravel/Lumen >= 5.1, (*2)

安装

composer require "lilocon/laravel-log-service"

配置

  1. config/app.php 注册 ServiceProvider (Laravel 5.5 无需手动注册)
'providers' => [
    // ...
    Lilocon\LaravelLogService\ServiceProvider::class,
],
  1. 创建配置文件和assets:
php artisan vendor:publish --provider="Lilocon\LaravelLogService\ServiceProvider"
  1. 修改应用根目录下的 config/log-service.php 中对应的参数即可。

日志收集

laravel5.5使用, (*3)

修改bootstrap/app.php文件,对应位置添加如下代码, (*4)

$app->configureMonologUsing(function ($logger) {
    (new Lilocon\LaravelLogService\Logging\Factory)($logger);
});

laravel5.6使用, (*5)

修改config/logging.php文件, 添加自定义channel, (*6)

    'LogService' => [
        'driver' => 'custom',
        'via' => \Lilocon\LaravelLogService\Logging\CreateLogger::class,
    ],

日志查看

修改app/Providers/RouteServiceProvider.php文件 添加路由即可, (*7)

Route::any('/log-service-viewer', 'Lilocon\LaravelLogService\Controller\ViewerController@index');

The Versions

29/06 2018