logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Prakash Kadam" <pka...@nulinkinc.com>
Subject Please Help me for ErrorHandler in log4cxx
Date Tue, 15 Feb 2005 06:11:40 GMT

Hi friends
  I am using the Log4cxx in my application, But got a big problem at error handler.
 If suppose logs r going to record at server side and server goes down ,then throw  the FALLBACK
ie handler we can divert the logs.
 I wrote the xml file for error handler,if one server goes down then divert the output to
other server ,If logs r not diverting to handler server once the PRIMARY goes down.

My xmlconfigurator is as follows

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>
        <appender name="PRIMARY" class="org.apache.log4j.net.SocketAppender">
             <param name="RemoteHost" value="localhost"/>
             <param name="Port" value="6044"/>
             <param name="ReconnectionDelay" value="5000"/>
             <errorHandler class="org.apache.log4j.varia.FallbackErrorHandler">
                 <param name="logger" value="root"/>
                 <root-ref/>
                 <logger-ref ref="Log_debug"/>
                 <logger-ref ref="Log_error"/>
                 <appender-ref ref="FALLBACK"/>
            </errorHandler>
        </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>
</log4j:configuration>




Mime
View raw message