nbah1990/laravel-logger-extension
Composer 安装命令:
composer require nbah1990/laravel-logger-extension
包简介
Package contains additional log drivers and notification channels
README 文档
README
Package contains:
- laravel/lumen + monolog -> fluentd integration;
- guzzle requests log middleware;
To install the package use:
composer require nbah1990/laravel-logger-extension
How to use fluentd integration:
- Add to the
logging.phpconfig a new channel:
'fluentd' => [ 'driver' => 'monolog', 'handler' => \LaravelLoggerExtension\Monolog\Handler\FluentdHandler::class, 'level' => 'debug', 'handler_with' => [ 'host' => env('FLUENTD_HOST'), 'port' => env('FLUENTD_PORT') ], ]
How to use guzzle/http log integration:
- Create or publish the config
laravel-logger-extension.php(you can find default config herevendor/nbah1990/laravel-logger-extension/src/LaravelLoggerExtension/config/laravel-logger-extension.php. By default, it looks like:
return [ // pass true to enable log of all guzzle requests 'guzzle_log_integration_enabled' => false, // guzzle client config with additions for logger 'guzzle_log_integration' => [ // you can add other guzzle client settings here // you can set your own handler for guzzle client // 'handler' => new \GuzzleHttp\HandlerStack(), // pass channels that should be used to write logs, they should be defined in the 'logging.php' configuration 'log_channels' => [ ], // format of the log message 'log_formatter' => new \GuzzleHttp\MessageFormatter( '{method}({code}) - {uri} - {req_body} - {res_body} - {req_headers} - {error}' ), //by default all responses will be wrote with this level 'log_default_level' => Psr\Log\LogLevel::DEBUG ] ];
统计信息
- 总下载量: 879
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-11-10