logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ebersole, Steven" <steven.ebers...@vignette.com>
Subject RE: Logging from same class to 2 different log files and each con figu red with its own level
Date Thu, 03 Apr 2003 16:55:18 GMT
One approach would be to define an appender using a
org.apache.log4j.varia.LevelMatchFilter set to INFO for the cumul.log file.
This assumes you are either using an XML config, or programtically
configuring log4j (as the property file config does not recoginize filters).

The exact details of how to set this up depend on some other things.  If you
want all classes to exhibit this behaviour, the simpliest case would be to:
1) define an appender for your "app.log" file
2) define an appender for your "cumul.log" file with an attached
3) attach both these appenders to rootLogger.


    |-----Original Message-----
    |From: De Moor Dries [mailto:dries.de.moor@awe.be]
    |Sent: Thursday, April 03, 2003 8:21 AM
    |To: 'log4j-user@jakarta.apache.org'
    |Subject: Logging from same class to 2 different log files and each
    |configu red with its own level
    |In the application I'm writing I need to log 2 things. 
    |First of all information to a log file called app.log ( 
    |... )
    |Secondly I have to log some information into a file 
    |cumul.log  ( only INFO)
    |I thought to  define 2 separate property files bu I think 
    |this won't work.
    |I might be better to define two appenders but how to set 
    |the log levels. 
    |And how to prevent that ERROR, DEBUG INFO log messages end 
    |up in the
    |CUMUL.log file.
    |Any advice on this topic. Maybe I'm totally wrong?
    |Kind regards,
    |To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
    |For additional commands, e-mail: log4j-user-help@jakarta.apache.org

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

View raw message