For every error log sent by mail we get another extra email with 2 lines of smtp debug log messages.
- Newly created symfony demo (
symfony new --demo
) - Configured monolog to send error messages by mail as in the docs
- symfony/monolog-bundle
3.7.0
- Symfony Versions
5.2.1
/5.2.9
/5.3.0-RC1
, - PHP 7.4.13
# config/packages/prod/monolog.yaml
monolog:
handlers:
main:
type: fingers_crossed
action_level: critical
handler: deduplicated
deduplicated:
type: deduplication
handler: symfony_mailer
symfony_mailer:
type: symfony_mailer
from_email: 'error@example.com'
to_email: 'error@example.com'
subject: 'An Error Occurred! %%message%%'
level: debug
Monolog sends error messages as expected, but every mail is followed by a second one with this content:
[2021-05-26T10:49:47.683298+02:00] app.DEBUG: Email transport "Symfony\Component\Mailer\Transport\Smtp\SmtpTransport" stopping [] []
[2021-05-26T10:49:47.722980+02:00] app.DEBUG: Email transport "Symfony\Component\Mailer\Transport\Smtp\SmtpTransport" stopped [] []
- no extra mail in
dev
ortest
environments - no extra mail when setting the framework config
test: true
inconfig/framework.yaml
Any ideas how to get rid of this extra email in production mode?
PS: There's also an open issue in the Symfony MonologBundle.