Is it possible to log only one level messages with Log4J

前端 未结 2 618
天命终不由人
天命终不由人 2021-01-12 00:34

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 w

2条回答
  •  盖世英雄少女心
    2021-01-12 00:56

    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

提交回复
热议问题