One possible solution is to implement a custom filter class.

1) extend the Filter class:

http://logging.apache.org/log4j/docs/api/org/apache/log4j/spi/Filter.htm
l

2) implement the decide(LoggingEvent) method.

3) Declare the filter in your config file (log4j.xml)

-Sean

> -----Original Message-----
> From: harsha bhogle [mailto:[EMAIL PROTECTED]
> Sent: Monday, May 10, 2004 5:11 PM
> To: [EMAIL PROTECTED]
> Subject: sending email with exception
> 
> Hi guys,
> I am a newbie to log4j and looking how I can configure log4j.xml to
send
> an exception and its stack trace to an email, as it happens using the
> SMTPEmailAppender. Ideally I would like to control or configure the
> exception object that would trigger an email (for ex: Send email for
all
> exceptions that extend certain xyz exception class)..Is this possible?
If
> not..what is closest thing that is possible without extending or
changing
> log4j original source code..
> Thanks
> Harsha
> 
> 

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

Reply via email to