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?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Maybe you can use a LevelMatchFilter?
http://wiki.apache.org/logging-log4j/LogToAppenderByLevel
As said Jarle you have to use LevelMatchFilter. I will demonstrate it with one simple exam:
In my source I append only ERROR messages to file with name TestLevels.txt