Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

send email on exception or error

I'd like to get an email when an error or exception happen in my web application, so that i can do the fix quickly.I've set a JSP error page. I like to show the error page to the client and at the same time get an email. I use jsp and a corresponding servlet and controller for each jsp.

How can i call the servlet to send email when the error or exception occurs? How is the configuration in web.xml?

Please help.

like image 305
coder247 Avatar asked Apr 29 '26 07:04

coder247


1 Answers

You can code your own solution, or you could use the email options in the standard logging packages out there. For example, log4j has SMTPAppender which will do what you need.

like image 79
Ben Avatar answered Apr 30 '26 21:04

Ben