You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Chandresh Turakhia <ch...@bhartitelesoft.com> on 2009/02/27 15:54:30 UTC

FailoverErrorHandler

http://mail-archives.apache.org/mod_mbox/logging-log4j-user/200306.mbox/%3C20030618225626.85221.qmail@web40612.mail.yahoo.com%3E

Dear Scott :

I came across your post. Is ur FailioverErrorHandler Apache type Open Source. Yes FallbackHandler seems to lose message with primary.
How did u send LoggingEvent to backup handler.


Thanks in advance.
Regards
Chand

> > --- Scott Heaberlin <he...@yahoo.com> wrote:
> > > No, we encountered similar behavior (losing the event that *caused*
> > > the primary appender to call errorHandler.error(...)) and looked at
> > > the source for the FallbackErrorHandler.
> > >
> > > Our solution was to create a new error handler class called
> > > FailoverErrorHandler which never replaces the primary
> > Appender. In the
> > > event of its primary Appender calling any signature of
> > error(...), our
> > > custom error handler class simply wrote to standard out and
> > sent the
> > > LoggingEvent to the backup appender.  (We did add some other custom
> > > code to our new error handler that would report errors by
> > other means
> > > as well, typically by using a named Logger instance... but that's
> > > another story).
> > >
> > > In short, the current FallbackErrorHandler implementation simply
> > > "switches" Appenders for the Logger whenever *some* but not
> > all of the
> > > ErrorHandler::error(...) methods are called.  For
> > "failover" behavior
> > > you'll have to implement your own custom ErrorHandler (it's
> > not that
> > > difficult though - one of my favorite aspects of Log4J is
> > its design -
> > > the simplicity of implementing/extending the Interfaces and base
> > > classes to achieve exactly the functionality your
> > enterprise requires.
> > >
> > > Hope this helps,
> > >
> > >
> > > -Scott Heaberlin
> > >


________________________________
This e-mail and all material transmitted with it are for the use of the intended recipient(s) ONLY and contains confidential and/or privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies and the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken pursuant to the contents of the present e-mail is strictly prohibited and is unlawful.
The recipient acknowledges that Bharti Telesoft Limited or its management or directors, are unable to exercise control or ensure the integrity over /of the contents of the information contained in e-mail. Any views expressed herein are those of the individual sender only and no binding nature of the contents shall be implied or assumed unless the sender does so expressly with due authority of Bharti Telesoft Limited. E-mail and any contents transmitted with it are prone to viruses and related defects despite all efforts to avoid such by Bharti Telesoft Limited.