different log levels and inheritance
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Vincent_FUCHS
Posted On:   Tuesday, January 11, 2005 02:50 AM

Hi all, I want to have two levels : in one file I want all the DEBUG stuff of all classes, and in another file I want only the INFO+ messages. All my classes are in the package divData2csv . Here is the beginning of my log4j.properties file : log4j.rootLogger=DEBUG,file_log_all log4j.logger.myLogger=INFO,file_log_normal,A1 log4j.logger.myLogger.divData2csv=DEBUG,file_log_all The loggers I create are for example myLogger.divData2csv.Console, myLogger.divData2csv.dumper.CSVdumper, etc. So if I understand well the way it's working, DEBUG messages should be processed by the log4j.logger.myLogger.divData2csv Logger (which should write everything in file_log_all appe   More>>

Hi all,



I want to have two levels : in one file I want all the DEBUG stuff of all classes, and in another file I want only the INFO+ messages.


All my classes are in the package divData2csv . Here is the beginning of my log4j.properties file :
			log4j.rootLogger=DEBUG,file_log_all
			
log4j.logger.myLogger=INFO,file_log_normal,A1
log4j.logger.myLogger.divData2csv=DEBUG,file_log_all



The loggers I create are for example myLogger.divData2csv.Console, myLogger.divData2csv.dumper.CSVdumper, etc.



So if I understand well the way it's working, DEBUG messages should be processed by the log4j.logger.myLogger.divData2csv Logger (which should write everything in file_log_all appender), which then pass the messages to his parent, the log4j.logger.myLogger Logger (which should write only the INFO+ messages in file_log_normal appender).


But that's not what's happening : I get all the DEBUG and INFO messages in file_log_normal appender, while I was hoping to have only the INFO.



Anybody would know how I can manage to do this ?



thanks



--


Vince    <<Less

Re: different log levels and inheritance

Posted By:   Anonymous  
Posted On:   Monday, February 14, 2005 04:13 AM

As I feel there is a small misunderstanding. The levels u specify in the config file limits the bottom level of the messages.

By using the DEBUG level u allow all the messages with priorities >= DEBUG to be stored in an appender.

To restrict them u have to use the THRESHOLD option.
About | Sitemap | Contact