开发者

Exception in Java EE application Email Notification Pattern

We have spring 3.0.x based appl开发者_如何学编程ication, we use SimpleMappingExceptionResolver which sends emails on an exception, when the exception happens within the DispatcherServlet.

This gives us following flexibility:

  1. Subject can include who the logged in user is, so that we can send personalized email to the user
  2. Subject also includes the server on which the error occurred
  3. The request params, request url, and headers -- helped us find some problems when search engine indexing the site.

However, lately we have been finding the exceptions have been occurring in the filters, and since this is not going through the Resolver, we dont get any emails.

The log4j email appenedr solution is very restrictive, subject is not dynamic, doesnot know the user who is logged in. We just think that Filter is for request processing, having a filter hijack the response on Exception, might cause unwanted results. Atleast this is our view. Please feel free to comment otherwise.

Is there an accepted pattern to resolve this issue.

Edited: We dont like the log4j email appender solution, and not writing another filter to send emails seems right.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜