auxmoney / opentracing-bundle-monolog
Symfony Opentracing bundle extension for Monolog
Installs: 725 320
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 6
Forks: 1
Open Issues: 1
Type:symfony-bundle
Requires
- php: ^8.0
- ext-json: *
- auxmoney/opentracing-bundle-core: ^1.3
- opentracing/opentracing: ^1.0.1
- symfony/monolog-bundle: ^3.4
Requires (Dev)
- phpmd/phpmd: ^2.12
- phpspec/prophecy-phpunit: ^2.0
- phpstan/phpstan: ^1.5
- phpunit/phpunit: ^9.5
- roave/security-advisories: dev-latest
- squizlabs/php_codesniffer: ^3.6
- symfony/filesystem: *
- symfony/process: *
This package is auto-updated.
Last update: 2024-11-06 20:08:45 UTC
README
This bundle adds a monolog processor to the OpentracingBundle to automatically enrich log contexts with the current span context.
Installation
Prerequisites
This bundle is only an additional plugin and should not be installed independently. See its documentation for more information on installing the OpentracingBundle first.
Require dependencies
After you have installed the OpentracingBundle:
- require the dependencies:
composer req auxmoney/opentracing-bundle-monolog
Enable the bundle
If you are using Symfony Flex, you are all set!
If you are not using it, you need to manually enable the bundle:
- add bundle to your application:
# Symfony 3: AppKernel.php $bundles[] = new Auxmoney\OpentracingMonologBundle\OpentracingMonologBundle();
# Symfony 4+: bundles.php Auxmoney\OpentracingMonologBundle\OpentracingMonologBundle::class => ['all' => true],
Configuration
No configuration is necessary, the Monolog bundle extension will automatically load the provided Processor
by tag.
Usage
Whenever a message is logged, the content is extended with extra information of the span context.
[2020-01-10 11:38:03] php.INFO: .... {"exception":"[object] (ErrorException(code: 0) ...."} {"opentracing-context":"{\"UBER-TRACE-ID\":\"15e880402e1a194715e880402e19a3e0:15e880402e19a3e0:0:1\"}"}
Development
Be sure to run
composer run-script quality
every time before you push code changes. The tools run by this script are also run in the CI pipeline.