Here are the codes:
Javacode:
Logger logger = Logger.getLogger(CreditLimitEditActionFromList.class.getName());
try {
// some code where exceptions can occur
} catch (Exception e) {
logger.error("unhandled exception: ",e);
}
Log4j-config:
log4j.rootLogger=ERROR, email
log4j.appender.email = org.apache.log4j.net.SMTPAppender
log4j.appender.email.BufferSize = 512
log4j.appender.email.From = server
log4j.appender.email.SMTPHost = localhost
log4j.appender.email.Subject = CreditLimitRequest Error Report
log4j.appender.email.To = [EMAIL PROTECTED]
log4j.appender.email.layout = org.apache.log4j.PatternLayout
log4j.appender.email.layout.conversionPattern = %d %-5p [%-10t] %c{2} - %m%n
Normally we get emails with mailbody like:
2006-08-22 09:22:33,667 61214430 [http-8090-Processor13] ERROR
com.omv.creditlimit.action.CreditLimitEditActionFromList.execute(CreditLimitEditActionFromList.java:295)-
unhandled exception:
java.lang.NullPointerException
at
com.omv.creditlimit.business.RulesEngineImpl.setDocumentID(RulesEngineImpl.java:366)
at
com.omv.creditlimit.action.CreditLimitEditActionFromList.execute(CreditLimitEditActionFromList.java:121)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Mario
-------- Original-Nachricht --------
Datum: Mon, 21 Aug 2006 12:40:12 -0400
Von: "Martin Gainty" <[EMAIL PROTECTED]>
An: "Tomcat Users List" <[email protected]>
Betreff: Re: Problem with Emailappender of Log4j
> Mario-
>
> can we see the exception handler and how you are capturing stackTrace?
>
> M-
> *********************************************************************
> This email message and any files transmitted with it contain confidential
> information intended only for the person(s) to whom this email message is
> addressed. If you have received this email message in error, please
> notify
> the sender immediately by telephone or email and destroy the original
> message without making a copy. Thank you.
>
>
>
> ----- Original Message -----
> From: "Mario Bittermann" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Monday, August 21, 2006 12:01 PM
> Subject: Problem with Emailappender of Log4j
>
>
> > Hi,
> >
> > we have a problem with our emailappender of Log4j.
> > We are using Log4js emailappender to be informed when an unhandled
> exception is thrown in an application.
> > If an exception is thrown we get an email with a exceptionstacktrace as
> mailbody. This works fine with Tomcat 4.
> >
> > Since we are using Tomcat 5.5.12 with Sun jdk 1.5_07 no stacktrace is
> sent! We get a mail with empty body.
> > I did some test with jdk 1.5 and Log4j and emailnotification works fine.
> But on Tomcat 5.5 we get empty email.
> >
> > Who can help? Any ideas?
> >
> > Thanks
> > Mario
> > --
> >
> >
> > Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
> > Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: [email protected]
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
--
"Feel free" – 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
---------------------------------------------------------------------
To start a new topic, e-mail: [email protected]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]