Im trying to debug an Internal Server Error on production that runs Yii2.
To do this, I added EmailTarget
to my config file as follows
if(!YII_DEBUG){
$logTarget[] = [
'class' => 'yii\log\EmailTarget',
'mailer' =>'mailer',
'levels' => ['error'],
'message' => [
'from' => ['mail@example.com'],
'to' => ['mymail@example.com'],
'subject' => 'Log',
],
'categories' => [
'yii\db\*',
'yii\web\HttpException:*',
],
'except' => [
'yii\web\HttpException:404',
'yii\web\HttpException:403',
'yii\web\HttpException:401'
]
];
}
then
'log' => [
'traceLevel' => 3,
'targets' => $logTarget,
],
Im not getting the 500 errors though. Am I doing smt wrong? Or are 500 errors not logged by default