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 "jaganprasad.d" <ja...@gmail.com> on 2008/11/06 07:59:31 UTC

How to suppress a particular message not to sent to log file or display in log file in log4j

Hi friends ,
this is jagan
Can u help me reagarding this please

How to suppress a particular message not to sent to log file or display in
log file in log4j
I am using ConsoleAppender and FileAppender
-- 
View this message in context: http://www.nabble.com/How-to-suppress-a-particular-message-not-to-sent-to-log-file-or-display-in-log-file-in-log4j-tp20356018p20356018.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


Re: How to suppress a particular message not to sent to log file or display in log file in log4j

Posted by th...@yahoo.com.
Jagen,

Can you offer a little more information about what you're trying to do?

If you are trying to suppress messages by level that's easy.  When you're setting up your appender, you can set the threshold value.  

For Example:
    <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
        <param name="Target" value="System.out"/>
        <param name="Threshold" value="INFO" />
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
        </layout>
    </appender>
    <appender name="SampleAppender" class="org.apache.log4j.FileAppender">
        <param name="File" value="../logs/SampleAppWeb.log"/>
        <param name="Threshold" value="DEBUG" />
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d [%l] %p %m%n%n"/>
        </layout>
    </appender>

In this example the Console appender will get messages up to the INFO level where the SampleAppender appender will get messages up to the DEBUG level.

-Joe




________________________________
From: jaganprasad.d <ja...@gmail.com>
To: log4j-user@logging.apache.org
Sent: Wednesday, November 5, 2008 11:59:31 PM
Subject: How to suppress a particular message not to sent to log file or display in log file in log4j


Hi friends ,
this is jagan
Can u help me reagarding this please

How to suppress a particular message not to sent to log file or display in
log file in log4j
I am using ConsoleAppender and FileAppender
-- 
View this message in context: http://www.nabble.com/How-to-suppress-a-particular-message-not-to-sent-to-log-file-or-display-in-log-file-in-log4j-tp20356018p20356018.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