定制 nbah1990/laravel-logger-extension 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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:

  1. Add to the logging.php config 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:

  1. Create or publish the config laravel-logger-extension.php(you can find default config here vendor/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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-11-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固