2010-05-22

Log4J supports SMTP+SSL appenders?..

Since 1.2.16, SMTP over SSL is supported by setting SMTPProtocol to "smpts".

Oh, I just googled the idea : email any critical (and/or) improperly handled exception which your application raises. Criticals go immediately while mishandled ones get cached for a while before firing out. Seems that SMTP appender does that priority throttling and also supports SSL. Could it be any better? More related discussions on that below (assuming your webapp uses Spring Web MVC).
Spring provides HandlerExceptionResolvers to ease the pain of unexpected exceptions occurring while your request is being handled by a controller which matched the request. HandlerExceptionResolvers somewhat resemble the exception mappings you can define in the web application descriptor web.xml. However, they provide a more flexible way to handle exceptions. They provide information about what handler was executing when the exception was thrown. Furthermore, a programmatic way of handling exception gives you many more options for how to respond appropriately before the request is forwarded to another URL (the same end result as when using the servlet specific exception mappings).
Instead of only redirecting to an error page, you could also put these exceptions in a database, so you have a list of the most common ones that occur. Joel and Jeff mention that they do this for StackOverflow, and that list becomes part of their bugs-to-fix list.

No comments: