You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most configuration options can be automatically populated by environment variables or in config/mailablelog.php, to generate it run php artisan vendor:publish.
51
+
To ensure all unhandled exceptions are mailed:
49
52
50
-
To ensure all unhandled exceptions are mailed, set up a mail logging channel and add it to your logging stack in config/logging.php:
53
+
1. create a `mail` logging channel in `config/logging.php`,
54
+
2. add this `mail` channel to your current logging stack,
55
+
3. add a `LOG_MAIL_ADDRESS` to your `.env` file to define the recipient.
51
56
52
57
```php
53
58
'channels' => [
54
59
'stack' => [
55
60
'driver' => 'stack',
56
-
// Add mail to the stack:
61
+
// 2. Add mail to the stack:
57
62
'channels' => ['single', 'mail'],
58
63
],
59
64
60
65
// ...
61
66
62
-
// Create a mail logging channel:
67
+
// 1. Create a mail logging channel:
63
68
'mail' => [
64
69
'driver' => 'mail',
70
+
'level' => env('LOG_MAIL_LEVEL', 'notice'),
71
+
65
72
// Specify who to mail the log to
66
73
'to' => [
67
74
[
68
-
'address' => 'errors@designmynight.com',
75
+
'address' => env('LOG_MAIL_ADDRESS'),
69
76
'name' => 'Error'
70
77
]
71
78
],
72
-
// Optionally specify who the log mail was sent by
73
-
// This is overidable in config/mailablelog.php and
74
-
// falls back to your global from in config/mail.php
75
-
'from' => [
76
-
'address' => 'errors@designmynight.com',
77
-
'name' => 'Errors'
78
-
],
79
+
80
+
// Optionally overwrite the sender.
81
+
// Default is config('mail.from.address') and config('mail.from.name')
82
+
// 'from' => [
83
+
// 'address' => env('LOG_MAIL_ADDRESS'),
84
+
// 'name' => 'Errors'
85
+
// ],
86
+
87
+
// Optionally overwrite the subject format pattern
0 commit comments