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/25 07:30:00 UTC

Fallback Handlers....

Dear all :
I use bit modified version of SocketAppender ( NewSocketAppender ); and FileAppender ( NewFileAppender ).
Question 1 ) Why is Fallback error not working ... is there something wrong in the file
Question 2 ) I want fallback handler for each logger    Database; ChannelGatewayLogs; BalanceLog; ConnectURL
Although Each write to same SocketAppender; How do I separate then at Fallback Handler level.

Thanks in advance for suggestions and help.

Chand

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">


        <appender name="A1"
                class="org.apache.log4j.net.NewSocketAppender">

                <errorHandler
                        class="org.apache.log4j.varia.FallbackErrorHandler">
                        <root-ref />
                        <appender-ref ref="fallback" />
                </errorHandler>

                <param name="remoteHost" value="172.16.1.215" />
                <param name="port" value="5999" />
        </appender>

        <appender name="fallback" class="org.apache.log4j.NewFileAppender">
                <param name="File" value="fallback1.log"/>
                <layout class="org.apache.log4j.PatternLayout">
                        <param name="ConversionPattern"
                                value="%r [%t] %-5p %c{2} %x - %m%n" />
                </layout>
        </appender>


        <logger name="com.mmoney.utilities.Database">
                <level value="ERROR" />
        </logger>

        <logger name="com.mmoney.common.ChannelGatewayLogs">
                <level value="INFO" />
        </logger>

        <logger name="com.mmoney.common.BalanceLog">
                <level value="INFO" />
        </logger>

        <logger name="com.mmoney.sms.ConnectURL">
                <level value="INFO" />
        </logger>



        <root>
                <priority value="INFO" />
                <appender-ref ref="A1" />
        </root>
</log4j:configuration>



-----Original Message-----
From: alekoc [mailto:ale4349koc@mail.ru]
Sent: Wednesday, February 25, 2009 2:09 AM
To: log4j-user@logging.apache.org
Subject: Re: One .log file for two different applications


Thank you, Jacob
I thought Log4j is reentrant, but it is not. If so, everything is clear.
Yes, I put log4j-1.2.14.jar file into Apache\apache-tomcat\lib and tried to
use it for all my web applications. An idea was to decrease WAR file sizes.

--
View this message in context: http://www.nabble.com/One-.log-file-for-two-different-applications-tp22159737p22190071.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


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.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


RE: Fallback Handlers....

Posted by Chandresh Turakhia <ch...@bhartitelesoft.com>.
Dear all :
Does Fallback Handler work with SocketAppender. It works fine if I use FileAppender as Primary appender.

Question  ) Which file does LogLog.debug("XXXX") gets written ??? How to run to see all these messages of log4j

Chand

-----Original Message-----
From: Chandresh Turakhia
Sent: Wednesday, February 25, 2009 12:00 PM
To: Log4J Users List
Cc: Chandresh Turakhia
Subject: Fallback Handlers....

Dear all :
I use bit modified version of SocketAppender ( NewSocketAppender ); and FileAppender ( NewFileAppender ).
Question 1 ) Why is Fallback error not working ... is there something wrong in the file
Question 2 ) I want fallback handler for each logger    Database; ChannelGatewayLogs; BalanceLog; ConnectURL
Although Each write to same SocketAppender; How do I separate then at Fallback Handler level.

Thanks in advance for suggestions and help.

Chand

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">


        <appender name="A1"
                class="org.apache.log4j.net.NewSocketAppender">

                <errorHandler
                        class="org.apache.log4j.varia.FallbackErrorHandler">
                        <root-ref />
                        <appender-ref ref="fallback" />
                </errorHandler>

                <param name="remoteHost" value="172.16.1.215" />
                <param name="port" value="5999" />
        </appender>

        <appender name="fallback" class="org.apache.log4j.NewFileAppender">
                <param name="File" value="fallback1.log"/>
                <layout class="org.apache.log4j.PatternLayout">
                        <param name="ConversionPattern"
                                value="%r [%t] %-5p %c{2} %x - %m%n" />
                </layout>
        </appender>


        <logger name="com.mmoney.utilities.Database">
                <level value="ERROR" />
        </logger>

        <logger name="com.mmoney.common.ChannelGatewayLogs">
                <level value="INFO" />
        </logger>

        <logger name="com.mmoney.common.BalanceLog">
                <level value="INFO" />
        </logger>

        <logger name="com.mmoney.sms.ConnectURL">
                <level value="INFO" />
        </logger>



        <root>
                <priority value="INFO" />
                <appender-ref ref="A1" />
        </root>
</log4j:configuration>



-----Original Message-----
From: alekoc [mailto:ale4349koc@mail.ru]
Sent: Wednesday, February 25, 2009 2:09 AM
To: log4j-user@logging.apache.org
Subject: Re: One .log file for two different applications


Thank you, Jacob
I thought Log4j is reentrant, but it is not. If so, everything is clear.
Yes, I put log4j-1.2.14.jar file into Apache\apache-tomcat\lib and tried to
use it for all my web applications. An idea was to decrease WAR file sizes.

--
View this message in context: http://www.nabble.com/One-.log-file-for-two-different-applications-tp22159737p22190071.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


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.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org