定制 axleus/axleus-log 二次开发

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

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

axleus/axleus-log

Composer 安装命令:

composer require axleus/axleus-log

包简介

Axleus Logging component

README 文档

README

This package provides logging via Monolog for all laminas-mvc and mezzio applications. It provides a log handler backed by laminas-db for writing logs to a database table. It also provides event listeners for error logging in both frameworks.

Mezzio Integration

Just pipe the middleware into your application as early as required to provide logging for all future middleware/handlers. If you are using the default Mezzio pipeline, this should be done in the config/pipeline.php file. If you are delegating your pipeline to configuration you can uncomment the following in the ConfigProvider class.

'middleware_pipeline' => $this->getPipelineConfig(),

To enable error logging in Mezzio or MVC simply provide the following top level config key from any ConfigProvider or config file.

return [
    \Axleus\Log\ConfigProvider::class => [
        'log_errors' => true,
    ],
];

Default Channels

By default, the following channels are provided for logging:

  • app
  • error
  • user

To provide some safety around channels the module provides Axleus\Log\LogChannel which is a BackedEnum.

Finally, you can import the file ./test/integration/TestFixtures/mysql.sql into your database to create the required table for logging. If you are not using mysql, then you can use it as a guide to create the table in your database of choice as long as its supported by laminas-db.

Everything else should just work out of the box.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2024-11-17