I encountered an issue with the mail system of laravel 5.8. As the documentation says, Mail & Local Development one can change the way of sending emails to let it write them to a log-file.
.env as well as the
config/mail.php-file have options for that.
So, I added (the key was not here originally) a
MAIL_LOG_CHANNEL-key to my
.env-file with the value "mail" and changed the value of the key
MAIL_DRIVER to "log".
Obviously, I added a new channel to the
[...] 'mail' => [ 'driver' => 'single', 'path' => storage_path('logs/mail-'.php_sapi_name().'.log'), 'level' => 'info', ], [...]
What ever I tried, the mail was never written to the seperate log-file. I testet the channel with a normal log-statement without any problem.
I switched from
MAIL_LOG_CHANNEL=mail added a default value to the section of the
[before] 'log_channel' => env('MAIL_LOG_CHANNEL'), [after] 'log_channel' => env('MAIL_LOG_CHANNEL', 'mail'),
not getting the width of a hair near to the log entry.
Only with the absolute basic configuration it actually writes the mail to the log but with this solution into the wrong log file.
Does anyone have an idea? It looks pretty strange to me.
Thanks for your help.