bytic/logger 问题修复 & 功能扩展

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

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

bytic/logger

最新稳定版本:2.0.1

Composer 安装命令:

composer require bytic/logger

包简介

Logger component for bytic

README 文档

README

Latest Version on Packagist Latest Stable Version Latest Unstable Version

Software License Quality Score Total Downloads

A PSR-3 logger component for bytic applications, built on top of Monolog.

Requires PHP 8.3+

Installation

composer require bytic/logger

Usage

Register the LoggerServiceProvider in your application bootstrap:

$container->addServiceProvider(new \Nip\Logger\LoggerServiceProvider());

The provider registers log and Psr\Log\LoggerInterface into the container.

Error Level Routing

PHP native errors (warnings, notices, deprecations) are converted to PSR-3 log entries by the bytic/debug ErrorHandler. Version 2.x uses \Nip\Logger\ErrorHandler\PhpErrorLevelMapper to map each E_* constant to the appropriate PSR-3 level:

PHP Error Type PSR-3 Level
E_WARNING warning
E_USER_WARNING warning
E_CORE_WARNING warning
E_COMPILE_WARNING warning
E_NOTICE notice
E_USER_NOTICE notice
E_DEPRECATED info
E_USER_DEPRECATED info
E_ERROR error
E_USER_ERROR error
E_RECOVERABLE_ERROR error
E_PARSE critical
E_CORE_ERROR critical
E_COMPILE_ERROR critical
E_STRICT debug

This replaces the previous behaviour where warnings and notices were incorrectly logged at ERROR level.

Migration Notes

When upgrading from 1.x:

  • Logger::getFormatter() and Logger::format() have been removed. Message formatting is now handled exclusively by Monolog's LineFormatter.
  • Inject Psr\Log\LoggerInterface via constructor injection instead of $container->get('log') where possible.

Inspiration

https://github.com/illuminate/log

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2018-09-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固