Releases: alexandre-daubois/monolog-processor-collection
Releases · alexandre-daubois/monolog-processor-collection
1.3.2
1.3.1
What's Changed
- Fix passing null to
str_starts_with()
by @alexandre-daubois in #7
Full Changelog: 1.3.0...1.3.1
1.3.0
What's Changed
- Add RequestSizeProcessor and improve resettable processors by @alexandre-daubois in #4
- Add SessionIdProcessor by @alexandre-daubois in #5
- Add ClientIpProcessor by @alexandre-daubois in #6
Full Changelog: 1.2.0...1.3.0
1.2.0
What's Changed
- Optimize a few processors, removed threshold from processors by @alexandre-daubois in #2
- Add limit to BacktraceProcessor by @alexandre-daubois in #3
New Contributors
- @alexandre-daubois made their first contribution in #2
Full Changelog: 1.1.1...1.2.0
1.1.1
Fix README examples
Full Changelog: 1.1.0...1.1.1
1.1.0
- Add
UuidProcessor
Full Changelog: 1.0.2...1.1.0
1.0.2
Full Changelog: 1.0.1...1.0.2
Fix BacktraceProcessor and improve README
Integration with Symfony and MonologBundle
You can register those processors to be used with Symfony and MonologBundle by adding the following configuration to
your config/packages/monolog.php
file:
use Monolog\Processor\ProcessorInterface;
return static function (ContainerConfigurator $configurator): void {
// ...
// register as many processors as you like, but keep in mind that
// each processor is called for each log record
$services = $configurator->services();
$services
->set(BacktraceProcessor::class)
->set(EnvVarProcessor::class)->args(['APP_ENV'])
->set(ProtocolVersionProcessor::class)
->set(SapiNameProcessor::class);
// ...
};
If you don't use autoconfigure, you need to tag the processors with monolog.processor
:
use Monolog\Processor\ProcessorInterface;
use MonologProcessorCollection\BacktraceProcessor;
use MonologProcessorCollection\EnvVarProcessor;
return static function (ContainerConfigurator $configurator): void {
// ...
$services = $configurator->services();
$services
->set(BacktraceProcessorAlias::class)
->tag('monolog.processor', ['handler' => 'main'])
->set(EnvVarProcessor::class)->args(['APP_ENV'])
->tag('monolog.processor', ['handler' => 'main']);
// ...
};
You can achieve the same configuration with YAML:
# config/packages/monolog.yaml
services:
Monolog\Processor\BacktraceProcessor:
tags:
- { name: monolog.processor, handler: main }
Monolog\Processor\EnvVarProcessor:
arguments:
- APP_ENV
tags:
- { name: monolog.processor, handler: main }
Or XML:
<!-- config/packages/monolog.xml -->
<!-- ... -->
<service id="Monolog\Processor\BacktraceProcessor" public="false">
<tag name="monolog.processor" handler="main" />
</service>
<service id="Monolog\Processor\EnvVarProcessor" public="false">
<argument>APP_ENV</argument>
<tag name="monolog.processor" handler="main" />
</service>
Initial release
1.0 Add HighResolutionTimestampProcessor