logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bender Heri <hben...@ergonomics.ch>
Subject AW: [SCL-4] funny behaviour using filters
Date Tue, 17 Nov 2009 17:06:18 GMT
I cannot see how you configure the LevelRangeFilter. See my example for separating console.out
and console.err:

    <appender name="CONSOLE.ERR" class="org.apache.log4j.ConsoleAppender">
        <param name="target" value="System.err"/>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d{HH:mm:ss.SSS} (%6r) %-5p [%-7t] %F:%L
%x - %m%n"/>
        </layout>
        <filter class="org.apache.log4j.varia.LevelRangeFilter">
            <param name="LevelMin" value="warn"/>
            <param name="LevelMax" value="fatal"/>
            <param name="AcceptOnMatch" value="false"/>
        </filter>
    </appender>

    <appender name="CONSOLE.OUT" class="org.apache.log4j.ConsoleAppender">
        <param name="target" value="System.out"/>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d{HH:mm:ss.SSS} (%6r) %-5p [%-7t] %F:%L
%x - %m%n"/>
        </layout>
        <filter class="org.apache.log4j.varia.LevelRangeFilter">
            <param name="LevelMin" value="trace"/>
            <param name="LevelMax" value="info"/>
            <param name="AcceptOnMatch" value="false"/>
        </filter>
    </appender>
 
Heri

-----Urspr√ľngliche Nachricht-----
Von: takidoso [mailto:Malte.Kempff@de.equens.com] 
Gesendet: Dienstag, 17. November 2009 17:55
An: log4j-user@logging.apache.org
Betreff: [SCL-4] funny behaviour using filters


Hi to all,
I am not sure, if that is a bug or a misconcetion of my own.
I have following log4j.xml :
----------------------------------
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="rootApp" class="org.apache.log4j.DailyRollingFileAppender"> 
         
         
         
        <layout class="org.apache.log4j.PatternLayout"> 
                 
        </layout>
</appender>

<appender name="gfcApp" class="org.apache.log4j.DailyRollingFileAppender"> 
         
         
         
        <layout class="org.apache.log4j.PatternLayout"> 
                 
        </layout>
</appender>

<appender name="fdAppErr" class="org.apache.log4j.DailyRollingFileAppender"> 
       
      
      <layout class="org.apache.log4j.PatternLayout">
           
      </layout>
        
        <filter class="org.apache.log4j.varia.LevelRangeFilter">
            
            
        </filter>
</appender>


<appender name="fdAppLog" class="org.apache.log4j.DailyRollingFileAppender"> 
         
         
         
        <layout class="org.apache.log4j.PatternLayout"> 
                 
        </layout> 
        <filter class="org.apache.log4j.varia.LevelRangeFilter">
            
            
        </filter>
</appender>

<appender name="fdAppTrace"
class="org.apache.log4j.DailyRollingFileAppender"> 
         
         
         
        <layout class="org.apache.log4j.PatternLayout"> 
                 
        </layout>
</appender>


<category name="de.equens.filedemon" additivity="false"> 
        <priority value="INFO" ></priority> 
        <appender-ref ref="fdAppErr" />
        <appender-ref ref="fdAppLog" />
</category>

<category name="de.equens.fileconverter" additivity="false"> 
        <priority value="WARN" ></priority> 
        <appender-ref ref="gfcApp" />
</category>


<root>
   <priority value="off"/>
</root>

</log4j:configuration>
-----------------------------------------------
I notice, that I cannot find any warning even though I put defenitely one
out.
I intend with this configuration that a warning would be found in
filedemon.log as well in filedemon.error, since I have put the logger (or
category) to  Level Info.
I cannot find the warning anywere, but errors and infos are where I expect
them.
What am i doing wrong?

Thanks for hints in advance

Takidoso


-- 
View this message in context: http://old.nabble.com/funny-behaviour-using-filters-tp26393423p26393423.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


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


Mime
View raw message