Reputation: 395
A beginner to Yii 2 framework, can anyone please tell me where do i find the log exception file or if have to create the file to store all exceptions then how should i create one ?
Upvotes: 3
Views: 10990
Reputation:
If you're are using the Advanced Application Template, each app (frontend, backend) has his own runtime/logs
folder with a log file.
Also, you can add in config file this setting, for components, to receive and email every time a level of error you've set, occurs:
'log' => [
'targets' => [
'email' => [
'class' => 'yii\log\EmailTarget',
'levels' => ['error'],
'message' => [
'from' => 'app-email',
'to' => 'your-email',
'subject' => 'Log message',
],
],
],
],
Very useful for production.
Upvotes: 3
Reputation: 3299
By default, Yii2 logs error and warning level events into the runtime/logs/app.log
file. You can read more about configuring logging in Yii2 in e.g. the Definitive Guide.
Upvotes: 6