Logging with yii2 keeps sending same emails

Hello all,

I have a bit of a strange problem. In my code I have the following configuration for logging


'log' => [

            'traceLevel' => YII_DEBUG ? 3 : 0,

            'targets' => [

                [

                    'class' => 'yii\log\FileTarget',

                    //'levels' => YII_DEBUG ? ['error', 'warning'] : ['error'], //, 'profile'],

                    'levels' => ['error', 'warning'],

                    'except' => [

                        'yii\i18n\I18N::format',

                        'yii\web\HttpException:400',

                        'yii\web\HttpException:404',

                    ],

                ],

                [

                    'class' => 'app\components\EmailTarget',

                    //'levels' => YII_DEBUG ? ['error', 'warning'] : ['error'],

                    'levels' => ['error', 'warning'],

                    'message' => [

                       'from' => YII_DEBUG ? ['backoffice@*****'] : ['backoffice@*****'],

                       'to' => ['*****'],

                       'subject' => 'CMS3 Backoffice Error Log',

                    ],

                    'except' => [

                        'yii\i18n\I18N::format',

                        'yii\web\HttpException:400',

                        'yii\web\HttpException:401',

                        'yii\web\HttpException:404',

                    ],

                ]

            ],

        ],

Three days ago I started receiving many error log mails, and after trying to understand if the application has some kind of problem, I noticed that the same emails keep coming every day. So today (22-02) I am receiving emais from 19-02 even though I have seen them and some times deleted them. I also tried removing the EmailTarget from my application logging, but the mails appear again. Does anyone have any idea where I can find the queue of the EmailTarget? My guess is that something does not get cleared properly there?

Any ideas are welcome. Thank you for your time,

Eleni

Hi,

I never used logs via EmailTarget…

But to find the queue you need to know HOW the mail is actually send. ;)

When you look at the code of EmailTarget:

You will find:

"In the above mailer is ID of the component that sends email and should be already configured."

Means:

How is your mailer component configured?

If you have specified a mailserver, it would be a good idea to check the queue of the mailserver being used. ;)

Best Regards

Thank you very much for your prompt reply. As far as I can see we use swiftmailer


'mail' => [

            'class' => 'yii\swiftmailer\Mailer',

            'useFileTransport' => false,

        ],



You think it might be an issue that we have "mail" instead of "mailer"? Even so I cannot seem to find where the queue of swiftmailer is going (http://www.yiiframework.com/doc-2.0/yii-swiftmailer-mailer.html). Any clue would be appreciated.

Thanks a lot