Thanks for the prompt answer Ceki, I really enjoyed reading your book, I used log4j in the past but I didn't realize until I read your book that log4j offers a lot of functionality that I wasn't aware of.
Well it's good to know that the ErrorHandler will not be supported in future log4j releases. I guess that leaves me with no failover provided by log4j. An option would be to implement a fallback socket appender and modifying my application to test the connection to the log server before every single log event. This will provide failover and fallback at runtime (which is what I precisly want) but on the other hand this will not be efficient at all and will slow down the application in general. Do you have any advice on how to implement failover using log4j Socket appenders? Thanks again, Oscar --- Ceki G�lc� <[EMAIL PROTECTED]> wrote: > Oscar, > > Your config file looks correct. SocketAppender has > not been tested to work > with FallbackErrorHandler. Moreover, given the > extreme difficulty in > testing generic error handlers, log4j 1.3 no longer > supports ErrorHandlers. > > At 11:03 PM 1/9/2005, Oscar Inostroza wrote: > >Hi, > > > >I am trying to configure a fallbackError handler > using SocketAppender. > >My "PRIMARY" socket appender on localhost port 4560 > contains an error > >handler that defines a "FALLBACK" socket appender > on localhost port 6045. > > > >When I test with my both log servers running (the > one on port 4560 and the > >other on port 6045) all the log events are > successfully logged in the > >primary log server on port 4560. > > > >Now when I try to test the fallback functionality > by stopping the primary > >log server on port 4560. No log events are logged > at all in the fallback > >log server. As a side info my application is a > servlet running on Tomcat > >and the stdout.log in tomcat shows an exception > logged by log4j that was > >unable to connect to the primary log server, this > tells my that log4j > >caught the fact that the primary server is down but > yet is not sending any > >log to the fallback server. > > > >I wonder what is wrong in my configuration file > (attached below) > >Help would be appreciated > >Thanks, > >Oscar > > > > <appender name="PRIMARY" > class="org.apache.log4j.net.SocketAppender"> > > <errorHandler > class="org.apache.log4j.varia.FallbackErrorHandler"> > > <root-ref/> > > <logger-ref ref="Log_debug"/> > > <logger-ref ref="Log_error"/> > > <appender-ref ref="FALLBACK"/> > > </errorHandler> > > <param name="RemoteHost" value="localhost"/> > > <param name="Port" value="4560"/> > > <param name="ReconnectionDelay" value="5000"/> > > </appender> > > > > <appender name="FALLBACK" > class="org.apache.log4j.net.SocketAppender"> > > <param name="RemoteHost" value="localhost"/> > > <param name="Port" value="6045"/> > > <param name="ReconnectionDelay" value="5000"/> > > </appender> > > > > <logger name="Log_debug" additivity="false"> > > <level value="debug"/> > > <appender-ref ref="PRIMARY"/> > > </logger> > > > > <logger name="Log_error" additivity="false"> > > <level value="ALL"/> > > <appender-ref ref="PRIMARY"/> > > </logger> > > > > <root> > > <level value="ALL" /> > > <appender-ref ref="PRIMARY"/> > > </root> > > > >--------------------------------------------------------------------- > >To unsubscribe, e-mail: > [EMAIL PROTECTED] > >For additional commands, e-mail: > [EMAIL PROTECTED] > > -- > Ceki G�lc� > > The complete log4j manual: > http://www.qos.ch/log4j/ > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > ===== Oscar ______________________________________________________________________ Post your free ad now! http://personals.yahoo.ca --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
