20030111 Saturday January 11, 2003

E-Mailing errors when an error-page is displayed I'm implementing an interesting feature this morning. When a user views the error-page of the application, an e-mail is sent to an administrator with a StackTrace. By error-page, I mean the "errorPage" attribute in a JSP's page declaration.

<%@ page language="java" errorPage="/errorPage.jsp" 
    contentType="text/html; charset=utf-8" %>

I'm using the mailer taglib to do this, but can't help thinking that Log4j already provides similar functionality. Doesn't it have an SMTPAppender or something like that. I briefly scanned their site, but didn't see anything. If you know how to configure this functionality - hook me up! Posted in Java at Jan 11 2003, 06:20:17 AM MST 4 Comments

Comments:

Take at look here: http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/net/SMTPAppender.html http://jakarta.apache.org/log4j/docs/manual.html (look for the Appenders and Layouts section) HTH, /rick

Posted by Rick Salsa on January 11, 2003 at 10:41 AM MST #

Thanks - I'll look into it! In the meantime, is anyone using the SMTPAppender that might be able to provide an example configuration?

Posted by Matt Raible on January 11, 2003 at 10:51 AM MST #

I have used log4j's SMTPAppender with success. Actually it was overwhelming, over 10.600 eMail in my Inbox only between Christmas and New Year! To be sure, you know what you're doing.

Posted by Philipp Meier on January 11, 2003 at 12:20 PM MST #

This is also a normal feature that the application server can configure, so that the application doesn't have to do it in the error page. I don't know which ones do it, but I know Orion and 9iAS do...

Posted by Joseph Ottinger on January 12, 2003 at 02:36 AM MST #

Post a Comment:
  • HTML Syntax: Allowed
Click me to subscribe
Matt Raible is a Web Architect who enjoys developing applications with open source technologies. Contact me for rates.
« November 2008
SunMonTueWedThuFriSat
      
1
2
3
6
7
8
9
10
11
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
      
Today

Recent Entries

Tag Cloud