Laravel 5.5 errors and exceptions that occur during operation in a production environment are forwarded to the specified mailbox

when the system is running online, an error or exception occurs, so it is not convenient to check the date.

so you want to send all the error or exception information to the specified mailbox when an error or exception occurs, so that you can know the wrong information in time.

what I want to ask now is, in which file method does this mailbox method be placed?

Mar.03,2021

you can catch all exception errors in: \ App\ Exceptions\ Handler::render method.

clipboard.png
I am the developer of API custom error messages, where you can capture and then customize the content of the email, and then send the email;
! It is not recommended to send here, but to join the queue and send mail through the queue


has not studied Laravel, (. Actually, I'm a front-end. No, no, no. ) easily searched, in in-depth discussion of PHP error exception handling mechanism and the corresponding implementation at the bottom of the Laravel framework here (the last paragraph), you can use the Monolog component to record, and then use the SwiftMailer component to send e-mail. Of course, it can also be implemented with PHP's native error_log function , so I won't repeat it here.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b31215-2b4e8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b31215-2b4e8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?