logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thisisafakeemaila...@yahoo.com
Subject Re: How to suppress a particular message not to sent to log file or display in log file in log4j
Date Thu, 06 Nov 2008 14:22:25 GMT
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 <jaganprasad.d@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


      
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message