You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Ma...@sdm.de on 2005/12/05 16:46:21 UTC

Logging different Log-Level for the same Logger

Hi,

I've got an application which is watched by an automatic monitoring prozess. For this prozess I need a logfile with log-messages from WARN to FATAL. If an error has happend, I want another log-file with loglevel from DEBUG to FATAL with different informations e.g. file and line number. My problem is, that the secound configuration  overwrits the first one. So I got only one log-file

This is my configuration:

log4cplus.logger.islog=ISWARN, ISLOG_FILE

log4cplus.appender.ISLOG_FILE=log4cplus::RollingFileAppender
log4cplus.appender.ISLOG_FILE.File=IS_SER.log
log4cplus.appender.ISLOG_FILE.MaxFileSize=100MB
log4cplus.appender.ISLOG_FILE.MaxBackupIndex=5
log4cplus.appender.ISLOG_FILE.layout=log4cplus::PatternLayout
log4cplus.appender.ISLOG_FILE.layout.ConversionPattern=    20%D{%y-%m-%d %H:%M:%S};  %10p ;%-70c{2} ;%-700.700m;;%n

log4cplus.logger=ISDEBUG, ISLOG_COMPLETE_FILE

log4cplus.appender.ISLOG_COMPLETE_FILE=log4cplus::RollingFileAppender
log4cplus.appender.ISLOG_COMPLETE_FILE.File=IS_SER_complete.log
log4cplus.appender.ISLOG_COMPLETE_FILE.MaxFileSize=100MB
log4cplus.appender.ISLOG_COMPLETE_FILE.MaxBackupIndex=5
log4cplus.appender.ISLOG_COMPLETE_FILE.layout=log4cplus::PatternLayout
log4cplus.appender.ISLOG_COMPLETE_FILE.layout.ConversionPattern=  20%D{%y-%m-%d %H:%M:%S};  %-10p; %c{2}; %m;%F;%L;%n

I'm using log4cplus, but you would help me, if you can tell me, if this configuration would work with log4j. Unfortunaltly the Trafik in the log4cplus forum is very poor.

Many Thanks

Mark