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
LevelMatchFilter.
3) attach both these appenders to rootLogger.

HTH


    |-----Original Message-----
    |From: De Moor Dries [mailto:[EMAIL PROTECTED]
    |Sent: Thursday, April 03, 2003 8:21 AM
    |To: '[EMAIL PROTECTED]'
    |Subject: Logging from same class to 2 different log files and each
    |configu red with its own level
    |
    |
    |Hello,
    |
    |In the application I'm writing I need to log 2 things. 
    |First of all information to a log file called app.log ( 
    |ERROR, DEBUG, INFO,
    |... )
    |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,
    |
    |
    |Dries
    |
    |-----------------------------------------------------------
    |----------
    |To unsubscribe, e-mail: [EMAIL PROTECTED]
    |For additional commands, e-mail: [EMAIL PROTECTED]
    |

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to