定制 rsg/log 二次开发

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

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

rsg/log

Composer 安装命令:

composer require rsg/log

包简介

Log utilities for RSG

README 文档

README

A collection of logging utilities that can be used by RSG.

Processors

StandardProcessor

This is the root processor. It does not decorate any other ProcessorInterfaces like the other ones in this library. It is used to add values that all records should contain.

Usage

Rsg\Log\StandardProcessor:
    tags: [ 'monolog.processor' ]
    arguments: [ '%env%', 'some-service' ]

WebProcessor

An adapter for Monolog's WebProcessor. It is used to add "extra" data for web requests. This also decorates any ProcessorInterface.

Usage

Rsg\Log\StandardProcessor:
    arguments: [ '%env%', 'some-service' ]

Rsg\Log\WebProcessor:
    tags: [ 'monolog.processor' ]
    arguments: [ '@Rsg\Log\StandardProcessor' ]

ContextProcessor

Copies important data from the context to the root of the record. This also decorates any ProcessorInterface. The purpose is to allow us to do something like $logger->info( 'some message', [ 'important_field' => 1 ] ); and be able to search "important_field=1" in our log aggregator.

Usage

Rsg\Log\StandardProcessor:
    arguments: [ '%env%', 'some-service' ]

Rsg\Log\ContextProcessor:
    tags: [ 'monolog.processor' ]
    arguments: [ '@Rsg\Log\StandardProcessor' ]

Additionally, one can customize the keys that will be copied.

Rsg\Log\StandardProcessor:
    arguments: [ '%env%', 'some-service' ]

Rsg\Log\ContextProcessor:
    tags: [ 'monolog.processor' ]
    arguments:
        $processor: '@Rsg\Log\StandardProcessor'
        $keys_to_escalate:
            - foo
            - bar
            - baz

Recommended Settings

The settings recommended for all RSG apps should include:

monolog:
    handlers:
        main:
            type: fingers_crossed
            action_level: error
            passthru_level: info
            handler: nested
            formatter: monolog.formatter

and

monolog.formatter:
    class: 'Monolog\Formatter\JsonFormatter'

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2019-08-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固