[ http://issues.apache.org/jira/browse/LOG4NET-1?page=comments#action_59897 ] Nicko Cadell commented on LOG4NET-1: ------------------------------------
Error handling in Appender is difficult. One potential way of implementing this is to use the error handler, however we may need to find a more robust solution. log4net appenders use the log4net.spi.IErrorHander interface to report errors. Change all the methods in this interface to add a LoggingEvent as the first argument. Change all the callers of this interface to pass the current logging event along with the error message. Change the implementation of log4net.Util.OnlyOnceErrorHandler to implement the interface changes. Add a property to the OnlyOnceErrorHandler called FallbackAppender of type IAppender, the value should be stored in a field. When one of the Error methods on OnlyOnceErrorHandler is called then call fallbackAppender.DoAppend with the logging event. This will cause the event to be routed to the fallback appender whenever an error occurs on the first appender. As each appender can have an ErrorHander defined this allows an unlimited number of fallback appenders. > Support Fallback Appenders > -------------------------- > > Key: LOG4NET-1 > URL: http://issues.apache.org/jira/browse/LOG4NET-1 > Project: Log4net > Type: New Feature > Components: Appenders, Core > Versions: 1.2.9 > Environment: From sourceforge > Reporter: Nicko Cadell > > Basically, I'm looking for the ability to set up a hierarchy of appenders so > that if a log to an ADONETAppender fails, log4net could then log to one of > more "back-up" appenders, for example, a RollingLogFile or SMTP. > Thanks, > Leo > Leo J. Hart IV -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira