2

I have an App in Symfony 5 and a bug reporting system with Monolog.

The problem occurs that when they send me an email with an error, I also get another email with the following

DEBUG
Message:

Email transport "Symfony\Component\Mailer\Transport\Smtp\SmtpTransport" stopping

Time:

2021-08-08T22:05:41.426193+00:00

Channel:

mailer

DEBUG
Message:

Email transport "Symfony\Component\Mailer\Transport\Smtp\SmtpTransport" stopped

Time:

2021-08-08T22:05:41.473234+00:00

Channel:

mailer

prod/monolog.yml

monolog:
    handlers:
        main:
            type:         fingers_crossed
            action_level: critical
            handler:      grouped
        grouped:
            type:    group
            members: [streamed, deduplicated]
        streamed:
            type:  stream
            path:  '%kernel.logs_dir%/%kernel.environment%.log'
            level: debug
        deduplicated:
            type:    deduplication
            handler: symfony_mailer
        symfony_mailer:
            type:         symfony_mailer
            from_email:   'infoexample@gmail.com'
            to_email:     'example@gmail.com'
            subject:      'An Error Occurred! %%message%%'
            level:        debug
            formatter:    monolog.formatter.html
            content_type: text/html

Any idea?

  • 1
    Can you try to replace _debug_ by _error_ on `level` parameter under symfony_mailer part ? – gdus Aug 26 '21 at 19:05
  • 1
    If you change the `level` then the mail might not contain other debug messages, which you probably want. I think you should exclude the mailer-channel by adding a line `channels: [!mailer]` – dbrumann Aug 27 '21 at 06:41
  • This is a dublicate of https://stackoverflow.com/q/67702288/1119601 – stollr Aug 22 '22 at 14:32
  • Does this answer your question? [Monolog: Send error logs by mail causes an extra mail for every error sent](https://stackoverflow.com/questions/67702288/monolog-send-error-logs-by-mail-causes-an-extra-mail-for-every-error-sent) – stollr Aug 22 '22 at 14:32

0 Answers0