nlappe/monolog-logdna-laravel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

nlappe/monolog-logdna-laravel

Composer 安装命令:

composer require nlappe/monolog-logdna-laravel

包简介

LogDNA handler for Monolog

README 文档

README

Monolog backend for logdna. This backend use logdna ingestion api.

Reason for the Fork

As everyone can see, this fork still uses the underlying curl implementation rather than Http/Guzzle way of Laravel. (which uses curl aswell, but you know...) I needed a fast, but timeout-configurable solution, so i went for a fork and adding the usual env/config handling.

Maybe i will change the curl impl to a more laravely way - but as time is always tight it might take a while.

Install

Install with compose composer require nlappe/monolog-logdna-laravel.

Usage

In yout config->logging.php add this to your 'channels' array:

    'logdna' => [
        'driver' => 'monolog',
        'level' => 'debug',
        'handler' => Nlappe\Monolog\Handler\LogdnaHandler::class,
        'handler_with' => [
            'ingestion_key' => env('LOG_DNA_API_KEY'),
            'hostname' => config('app.name'),
        ],
        'formatter' => 'default',  // ##### does not work without this!
    ],

Then configure it to be used. E.g. add it to the stack channel as an additional log target.

'channels' => [
    'stack' => [
        'driver' => 'stack',
        'channels' => ['single', 'logdna'],
        'ignore_exceptions' => false,
    ],
    ...
 ]

Config

To modify the curl timeouts create the follwoing keys in your logging.php config file:
return [
'curl_connect_timeout' => env('CURL_CONNECT_TIMEOUT', 3),
'curl_request_timeout' => env('CURL_REQUEST_TIMEOUT', 5),
]

curl_connect_timeout is responsible for the connection timeout. If curl doesnt receive any bytes in the given amount of seconds it will throw an error. curl_request_timeout is responsible for the request timeout. if the request takes longer than the specified time in seconds, it will abort and throw an error.

License

This project is licensed under LGPL3.0. See LICENSE file for details.

Versions

Version 1.x is php5 compatible version while 2.x is php7.

Test

To test the project, simply call make or make test. Everything runs in docker container.

Clean

To clean your system, call make clean. Take note that if you use the same docker images as this project, you might not want to clean. Read the Makefile for more information.

统计信息

  • 总下载量: 27
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: LGPL-3.0-only
  • 更新时间: 2020-09-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固