views:

89

answers:

1

If I set the log level to DEBUG, All messages with log level >= DEBUG will be logged/printed. But can I set log level to only DEBUG, such that messages with log level only with DEBUG will be printed. Or can give a range like print all messages whose log level is >=DEBUG but < ERROR?

+2  A: 

Maybe you can use a LevelMatchFilter?

At some situation, You have to write logs to different outputs according to the level. how can it be done by simply configuration of Log4j? There are some methods below.

http://wiki.apache.org/logging-log4j/LogToAppenderByLevel

Jarle Hansen