Skip to content

Conversation

@HypeMC
Copy link
Member

@HypeMC HypeMC commented Aug 26, 2025

Q A
Branch? 7.3
Bug fix? yes
New feature? no
Deprecations? no
Issues -
License MIT

An alternative to #61511.

@fabpot
Copy link
Member

fabpot commented Aug 26, 2025

Thank you @HypeMC.

@fabpot fabpot merged commit 8ec0d38 into symfony:7.3 Aug 26, 2025
10 of 11 checks passed
@HypeMC HypeMC deleted the named-serializers-fix branch August 26, 2025 07:16
@fabpot fabpot mentioned this pull request Aug 29, 2025
GromNaN added a commit to symfony/monolog-bundle that referenced this pull request Sep 24, 2025
… or handler (HypeMC)

This PR was merged into the 3.x branch.

Discussion
----------

Don't add processor to all loggers if tags specify a channel or handler

Similar to symfony/symfony#61526.

When you add a custom processor to a specific channel or handler, it gets added to **all** channels because `ProcessorInterface` is [registered for autoconfiguration](https://github.com/symfony/monolog-bundle/blob/58b98dcf5d3c818679f078d514284b16cc986d34/DependencyInjection/MonologExtension.php#L106-L108).

Here's a simple example:

```php
#[AsMonologProcessor('my_channel')]
final class MyProcessor implements ProcessorInterface
{
    public function __invoke(LogRecord $record) {}
}
```

You'd expect this processor to be registered only for `my_channel`, but due to autoconfiguration it's added to every channel.

The workaround is to disable autoconfiguration and add an explicit tag.

```yaml
services:
    App\MyProcessor:
        autoconfigure: false
        tags:
            - monolog.processor: { channel: 'my_channel' }
```

This PR ensures a processor is not added to all channels when an explicit channel or handler is configured.

Commits
-------

09b4bae Don't add processor to all loggers if tags specify a channel or handler
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Nov 25, 2025
…added to default (HypeMC)

This PR was merged into the 7.3 branch.

Discussion
----------

[Serializer] Named serializer normalizers are no longer added to default

It is no longer necessary to set `autoconfigure` to `false` since symfony/symfony#61526.

Commits
-------

4fb1a4f [Serializer] Named serializer normalizers are no longer added to defualt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants