Skip to content

Releases: alexandre-daubois/monolog-processor-collection

1.3.2

23 Dec 17:56
Compare
Choose a tag to compare

What's Changed

New Contributors

  • @ToshY made their first contribution in #9

Full Changelog: 1.3.1...1.3.2

1.3.1

08 Nov 15:17
Compare
Choose a tag to compare

What's Changed

Full Changelog: 1.3.0...1.3.1

1.3.0

08 Nov 10:42
Compare
Choose a tag to compare

What's Changed

Full Changelog: 1.2.0...1.3.0

1.2.0

08 Nov 08:25
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 1.1.1...1.2.0

1.1.1

07 Nov 18:03
Compare
Choose a tag to compare

Fix README examples

Full Changelog: 1.1.0...1.1.1

1.1.0

07 Nov 12:35
Compare
Choose a tag to compare
  • Add UuidProcessor

Full Changelog: 1.0.2...1.1.0

1.0.2

07 Nov 09:21
Compare
Choose a tag to compare

Full Changelog: 1.0.1...1.0.2

Fix BacktraceProcessor and improve README

07 Nov 09:12
Compare
Choose a tag to compare

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

06 Nov 15:23
Compare
Choose a tag to compare
1.0

Add HighResolutionTimestampProcessor