承接 agielks/yii2-log-json 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

agielks/yii2-log-json

最新稳定版本:1.0.0

Composer 安装命令:

composer require agielks/yii2-log-json

包简介

Convert your yii2 application logs as json and save it to file, redis, or logstash

README 文档

README

Convert your yii2 application logs as json and save it to file, redis, or logstash

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist agielks/yii2-log-json "~1.0"

or add

"agielks/yii2-log-json": "~1.0"

to the require section of your composer.json file.

Basic usage

File Target

'components' => [
    // ...
    'log' => [
        'traceLevel' => YII_DEBUG ? 3 : 0,
        'targets' => [
            [
                'class' => 'agielks\yii2\log\json\FileTarget',
                'levels' => ['error', 'warning'],
                'except' => [
                    'yii\web\HttpException:*',
                ],
            ],
        ],
    ],
    // ...
],

Logstash Target Configuration

'components' => [
    // ...
    'log' => [
        'traceLevel' => YII_DEBUG ? 3 : 0,
        'targets' => [
            [
                'class' => 'agielks\yii2\log\json\LogstashTarget',
                'dsn' => '127.0.0.1:5000',
                'index' => 'my-index',
                'type' => 'log',
                'levels' => ['error', 'warning'],
                'except' => [
                    'yii\web\HttpException:*',
                ],
            ],
        ],
    ],
    // ...
],

Redis Target Configuration

'components' => [
    // ...

    // Redis connection
    'redis' => [
        'class' => 'yii\redis\Connection',
        'hostname' => '127.0.0.1',
        'port' => 6379,
        'database' => 0,
    ],

    // Redis log configuration
    'log' => [
        'traceLevel' => YII_DEBUG ? 3 : 0,
        'targets' => [
            [
                'class' => 'agielks\yii2\log\json\RedisTarget',
                'db' => 'redis',
                'levels' => ['error', 'warning'],
                'except' => [
                    'yii\web\HttpException:*',
                ],
            ],
        ],
    ],
    // ...
],

More Usage

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-06