Hello,

We use WebSphere as application server which has the standard logging files
SystemOut.log and SystemErr.log.
I want to create a log4j configuration with a special logger "SpecialLogger"
which logs all debug/info/error messages to a special log file. Additionally
error messages should be logged to SystemErr.log but the debug/info messages
from this logger should not be logged to SystemOut.log (but other info
messages not from this logger should be logged).
Maybe there is a solution with additivity="false" and LevelRangeFilter but I
cannot get it work like described. 
Here is my last try:

<?xml version="1.0"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/";>
    <appender name="stdout" class="org.apache.log4j.ConsoleAppender">
        <layout class="org.apache.log4j.PatternLayout">
                
        </layout>
    </appender>
  <appender name="SpecialLoggerAppender"
class="org.apache.log4j.RollingFileAppender">
        
        
        
        <layout class="org.apache.log4j.SimpleLayout"/>
         <filter class="org.apache.log4j.varia.LevelRangeFilter">
                        
                                        
        </filter>
    </appender> 
        <logger name="SpecialLogger" additivity="false">
                <level value="error" />
                <appender-ref ref="SpecialLoggerAppender" />
        </logger>
        
        <root>
        <level value="error"/>
        <appender-ref ref="stdout" />
    </root>
</log4j:configuration>


Can someone help please?
Thanks in advance
-- 
View this message in context: 
http://old.nabble.com/Logging-with-specialized-logger-for-webapplication-tp34066057p34066057.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to