smartframe-technologies/laminas-monolog-logger 问题修复 & 功能扩展

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

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

smartframe-technologies/laminas-monolog-logger

最新稳定版本:0.5.1

Composer 安装命令:

composer require smartframe-technologies/laminas-monolog-logger

包简介

Implementation monolog library using laminas service manager and other libs

README 文档

README

The LaminasMonologLogger provides integration of the Monolog library into the Laminas framework and Mezzio projects.

Build Status Coverage Status

Installation

Install the latest version with

$ composer require smartframe-technologies/laminas-monolog-logger

Configuration

Start by creating a logging configuration file (i.e. config/autoload/logger.global.php) with minimal configration

If are you using ConfigAggregator library already have defined ConfigProvider
More information in ConfigProviders section

Minimal config settings

<?php
return [
    'logger' => [
        //global processors
        'processors' => [],
        //global handlers
        'handlers' => [
            Monolog\Handler\StreamHandler::class => [
                'stream' => '/var/log/php.log'
                'level' => Monolog\Logger::INFO,
            ],
        ],
        //logger services
        Monolog\Logger::class => [
            'channel_name' => 'application' //required
        ]
    ]
];

Full config settings

<?php

declare(strict_types=1);

use Monolog\Logger;
use Monolog\Processor\HostnameProcessor;
use Monolog\Processor\IntrospectionProcessor;
use Monolog\Processor\MemoryPeakUsageProcessor;
use Monolog\Processor\ProcessIdProcessor;
use Monolog\Processor\WebProcessor;
use SmartFrame\Logger\Processor\ModuleProcessor;

return [
    'logger' => [
        //global processors
        'processors' => [
            MemoryPeakUsageProcessor::class => [],
            WebProcessor::class => [],
            IntrospectionProcessor::class => [],
            ModuleProcessor::class => [],
            HostnameProcessor::class => []
        ],
        //global handlers
        'handlers' => [
            Monolog\Handler\StreamHandler::class => [
                'stream' => '/var/log/global.log',
                'fingersCrossed' => Logger::WARNING,
                'level' => Logger::INFO,
                'whatFailure' => true
            ],
        ],
        //logger services
        Monolog\Logger::class => [
            'channel_name' => 'php',
            //logger specific processors
            'processors' => [
                ProcessIdProcessor::class => []
            ],
            //logger specific handlers
            'handlers' => [
                Monolog\Handler\StreamHandler::class => [
                    'stream' => '/var/log/php.log'
                ],

            ]
        ],
        'ApplicationLogger' => [
            'channel_name' => 'application',
            'handlers' => [
                Monolog\Handler\StreamHandler::class => [
                    'stream' => '/var/log/application.log'
                ],
            ]
        ],
        'RequestLogger' => [
            'channel_name' => 'requests'
        ],
        'ErrorLogger' => [
            'channel_name' => 'errors',
            'processors' => [],
            'handlers' => [
                Monolog\Handler\ErrorLogHandler::class => []
            ]
        ],
        'ConsoleLogger' => [
            'channel_name' => 'console'
        ],
        'SecurityLogger' => [
            'channel_name' => 'security'
        ]
    ],
];

License

Copyright 2020 SmartFrame Technologies

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2020-12-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固