Have you looked at ErrorHandlers at all? 

If the failure occurs at appender initialization time then it can throw an exception, 
you can catch it and exit the application if you want to. 

Ceki


At 09:57 17.07.2001 +0200, VAYALATHU,ROY-VARGHESE (HP-Switzerland,ex1) wrote:
>Hello Sam,
>        Thank you very much for your support.
>        I also have a wrapper on top of log4j. But Say if JMS Appender fails
>to initialize then I want my singleton to be notified so  that it can look
>for initializing say a fall back appender. I don't need both together. 
>        Now this is my question How can the singleton be notified, if the
>JMS Appender fails to initialize ( Say jms topic does not exist ).
>
>Take Care,
>Roy
>
>-----Original Message-----
>From: Sam Newman [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, July 17, 2001 9:43 AM
>To: LOG4J Users Mailing List
>Subject: Re: Appender problem. Please help 
>
>
>Sorry if I've missed the point of your email, or if any of this is super
>obvious....but anyhoo.
>
>I wrap my use of log4j up in a singleton object (implementing my interface
>Logger), e.g. I do something like this:
>
>Logger logger = Log4jLogger.getInstance();
>
>getInstance() returns the only instance of the Log4jLogger in the following
>way:
>
>public static Log4jLogger getInstance() {
>  if (_me == null) {
>    _me = new Log4jLogger();
>  }
>  return _me;
>}
>
>The creation method is protected, so you have to use the getInstance(). In
>my creation method I actually configure the log (in my case I use a
>PropertiesConfigure). I would guess you'd want to initialise your appender
>here and then if it fails just do a System.exit(1) and print an error to
>standard error. Would'nt it be better to have a fall back position to make
>your program more robust (unless the use of the SMTPappender is core to your
>program naturally) - e.g. if SMTPAppender fails, perhaps use a
>ConsoleAppender instead?
>
>sam
>----- Original Message -----
>From: "VAYALATHU,ROY-VARGHESE (HP-Switzerland,ex1)" <[EMAIL PROTECTED]>
>To: "'LOG4J Users Mailing List'" <[EMAIL PROTECTED]>
>Sent: Tuesday, July 17, 2001 8:09 AM
>Subject: Appender problem. Please help
>
>
>> Hello All,
>> This is in continuation to my earlier mail.
>> I have some important information to be logged. So I tried JMS
>> appender for logging the same. My requirement is that if I can't
>initialize
>> the appender then I should exit the program. How can I achieve this.
>> Please provide me an answer at the earliest possible.
>>
>> Take Care,
>> Roy
>>

--
Ceki Gülcü - http://qos.ch


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

Reply via email to