Another approach is to use Log4j's FallbackErrorHandler.

see
http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/varia/FallbackErro
rHandler.html
==> "The FallbackErrorHandler implements the ErrorHandler interface such
that a secondary appender may be specified. This secondary appender takes
over if the primary appender fails for whatever reason. 
The error message is printed on System.err, and logged in the new secondary
appender."

Mike


-----Original Message-----
From: Avner BenHanoch [mailto:[EMAIL PROTECTED]
Sent: Sunday, June 08, 2003 3:32 AM
To: Log4J Users List; [EMAIL PROTECTED]
Subject: Re: How to switch appender in case of runtime exception


try myLogger.removeAllAppenders() and then myLogger.addAppender(...)

----- Original Message -----
From: "Sanjeev Sahay" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 06, 2003 10:59 AM
Subject: How to switch appender in case of runtime exception


> Hi,
>
> Can anybody tell me how to log into file in case of Database problem (like
> Database server is down)? I'm using JdbcAppender for logging into
database.
> Need to divert the logging to file in case of any exception while logging
to
> Database. How to go about this?
>
> Regards,
>
> Sanjeev
>
>
> ---------------------------------------------------------------------
> 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]

-------------------------------------------------------------------------------
This message and any included attachments are from Siemens Medical Solutions 
USA, Inc. and are intended only for the addressee(s).  
The information contained herein may include trade secrets or privileged or 
otherwise confidential information.  Unauthorized review, forwarding, printing, 
copying, distributing, or using such information is strictly prohibited and may 
be unlawful.  If you received this message in error, or have reason to believe 
you are not authorized to receive it, please promptly delete this message and 
notify the sender by e-mail with a copy to [EMAIL PROTECTED]  Thank you

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

Reply via email to