I have log - target:
'error' => [ 'class' => 'yii\log\EmailTarget', 'levels' => ['error', 'warning'], 'except' => ['yii\web\HttpException:404'], 'message' => [ 'from' => ['XXXXXXX'], 'to' => ['XXXXXXX'], 'subject' => 'XXXXXX - error', ], ],
It will send me an email whenever an application error/warning occurs. It’s OK.
The problem is a “long duration” error (for example database down, but it could be anything else).
It sends an email for every visit the website.
With high traffic = hundreds of emails with the same error during one minute.
How prevent recurring emails with the same error?