symfony-docs icon indicating copy to clipboard operation
symfony-docs copied to clipboard

[Monolog] Mailer sends second mail if monolog is configured to email errors

Open stollr opened this issue 2 years ago • 2 comments

As pointed out here there is an issue with the configuration example on https://symfony.com/doc/5.4/logging/monolog_email.html (same issue with newer versions of the doc). Following the first config block, one will always get two error mails if an error occurs.

@raziel057 already explained the reason for the second mail and how to fix it.

I suggest to add the channel constraint to the main handler to the documentation example. So that we have a working example.

What do you think?

stollr avatar Aug 22 '22 15:08 stollr

and how to fix it.

To me it is more how to hide it Excluding mailer channel can hide other valueable logs i think

But i do not know how to properly fix the root issue, appart removing the log :/

94noni avatar Aug 23 '22 16:08 94noni

Excluding mailer channel can hide other valueable logs i think

Yes, that was my initial thought, too. But if the mail was sent, there is at least no fatal issue with the mail sending ;-)

stollr avatar Aug 25 '22 07:08 stollr

Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?

carsonbot avatar Sep 04 '23 09:09 carsonbot

I don't know if this is a doc issue or a code issue in Monolog bundle. See https://github.com/symfony/monolog-bundle/issues/405

What should we do here?

javiereguiluz avatar Sep 07 '23 15:09 javiereguiluz

Let's close for now in favor of https://github.com/symfony/monolog-bundle/issues/405 and we'll reopen if needed when a decision is done there. Thanks.

javiereguiluz avatar Sep 18 '23 15:09 javiereguiluz

That's fine for me. Thanks 👍

stollr avatar Sep 18 '23 15:09 stollr