承接 request-tracing/request-tracing-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

request-tracing/request-tracing-bundle

Composer 安装命令:

composer require request-tracing/request-tracing-bundle

包简介

Symfony bundle for request tracing

README 文档

README

Symfony bundle for request tracing.

This bundle ships with a Monolog processor and a Guzzle Middleware for logging and propagating request IDs.

Installation

composer require request-tracing/request-tracing-bundle

If you are using Symfony Flex everything works out-of-the-box. If not, you should add this bundle manually to your config/bundles.php.

By default, the bundle will look for a X-Request-Id HTTP request header and use its value if present. You can configure the header name with the following config:

# config/packages/request_tracing.yaml
request_tracing:
  header: my_custom_header_name

Monolog

This bundle will add the request ID to the context of each log record created with Monolog. Be sure to install the Monolog bundle first:

composer require symfony/monolog-bundle

I recommend formatting Monolog in JSON format for easier log processing in tools like Datadog:

# config/packages/monolog.yaml
monolog:
  handlers:
    main:
      formatter: monolog.formatter.json

Guzzle

If you use the Guzzle HTTP client in your application you can use the Guzzle Middleware provided by this bundle to pass the request ID of the original HTTP request as a header to a subsequent HTTP request. This way you will be able to correlate HTTP requests when analyzing (access) logs.

The middleware is available in the Dependency Injection Container by its FQCN. Here's an example services configuration:

services:
  GuzzleHttp\Client:
    arguments:
      - { handler: '@GuzzleHttp\HandlerStack' }

  GuzzleHttp\HandlerStack:
    factory: ['GuzzleHttp\HandlerStack', 'create']
    calls:
      - push: ['@RequestTracing\RequestTracingBundle\GuzzleHttp\RequestIdMiddleware']

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-04-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固