bmwx591/request-logger 问题修复 & 功能扩展

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

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

bmwx591/request-logger

最新稳定版本:v0.0.2

Composer 安装命令:

composer require bmwx591/request-logger

包简介

Library for logging application requests

README 文档

README

MIT License

 The simple template for create request logging system.

  All that you need is to use some logger that implement Psr\Log\LoggerInterface and request mapper that implements Bmwx591\RequestLogger\Mapper\RequestMapperInterface for mapping log message and context. If you want to use some special rules to check if you need to log one request or another you can add rules resolver implementation of Bmwx591\RequestLogger\RulesResolver\RulesResolverInterface. If you won`t add rules resolver than all requests will be logged.

  Logger works with wrapped requests and responses so you can write you own wrappers by implement Bmwx591\RequestLogger\Logger\WrappedRequest and Bmwx591\RequestLogger\Logger\WrappedResponse interfaces to add ability to work with you type of requests and responses if they don`t implement PSR-7 Psr\Http\Message\RequestInterface and Psr\Http\Message\ResponseInterface.

Usage/Examples

use Bmwx591\RequestLogger\Logger\RequestLogger;

$requestLogger = new RequestLogger(
    new SomeLogger(), // some implementation of Psr\Log\LoggerInterface
    $requestMapper, // implementation of RequestMapperInterface for map message and content for request
    $rulesResolver // implementation of RulesResolverInterface or null
);

$requestLogger
    ->incomingRequest(<wrapped request>)
    ->outgoingResponse(<wrapped response>)
    ->addExternal(<ExternalRequest instance>)
    ->pushLogs();

Authors

Running Tests

To run tests, run the following command

vendor/bin/phpunit

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固