Answer the question
In order to leave comments, you need to log in
How to trigger Error Log in Yii2 Swiftmailer?
$mailer = Yii::$app->mailer;
$mailer->enableSwiftMailerLogging = true;
$mailer->compose()
...
->send();
//Как получить ошибки которые возникли при отправке?
Answer the question
In order to leave comments, you need to log in
Judging by this commit https://github.com/yiisoft/yii2-swiftmailer/commit... everything is logged into the general log.
+ * In order to catch logs written by this class, you need to setup a log route for 'yii\swiftmailer\Logger::add' category.
+ * For example:
+ *
+ * ~~~
+ * 'log' => [
+ * 'targets' => [
+ * [
+ * 'class' => 'yii\log\FileTarget',
+ * 'categories' => ['yii\swiftmailer\Logger::add'],
+ * ],
+ * ],
+ * ],
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question