In fact, SMTPAppender does exactly what I want. It did not work only because 
I did the mistake of setting its threshold parameter to ERROR instead of 
DEBUG.

Thanks anyway,

Nicolas

On Monday 16 July 2001 20:44, you wrote:
> At 18:52 16.07.2001 -0400, Nicolas Marchildon wrote:
> >Hi,
> >
> >I have a critical process that I want to monitor. Whenever there is an
> > error, I want to be emailed all the debugging information, consisting of
> > the DEBUG statements starting from the beginning of the process.
> >
> >At the beggining of the critical process, I set up a SMTPAppender, and add
> > it to the root category. When I'm done, I remove the appender. I set up
> > the SMTPAppender to send its buffer on ERRORs.
> >
> >I realized I was e-mailed only with the ERROR log statement, without the
> > DEBUG ones, and I looked at the log4j source code to figure out why. The
> > SMTPAppender does not seem to use its buffer really much, because it does
> > not get all the events it should.
> >
> >In org.apache.log4j.AppenderSkeleton.doAppend(LoggingEvent), I saw the
> >following:
> >
> >    if(!isAsSevereAsThreshold(event.priority)) {
> >      return;
> >    }
> >
> >When I comment this out, the SMTPAppender gets the logging statements and
> > adds them to its buffer.
> >
> >But I think it also means all appenders will get the log statements even
> > if they were set up to receive them beginning at a specified threshold.
> > Therefore, commenting out this "isAsSevereAsThreshold" check is not a
> > solution.
> >
> >My advice is that there should be two thresholds for the SMTPAppender. The
> >first is the current standard threshold. The SMTPAppender would not get
> > events with lesser importance than this threshold.
> >
> >The other threshold would be the one that would actually trigger the
> > e-mail to be sent, and would be specific to the SMTPAppender. By default,
> > it could be set to be the same as the standard threshold, so the class
> > behaves as it does right now.
> >
> >Does that makes sense?
>
> I am afraid it does not make sense. In particular because the threshold
> parameter and the triggering threshold are separate independent variables.
> Regards, Ceki
>
>
> --
> Ceki Gülcü - http://qos.ch
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to