I'm working on a very large java application with log4j, and I was wondering if there is a way to extract in runtime the number of active loggers? Or what are the existing loggers in the application? My end goal is to get a list of all loggers and change their level in runtime. Thank you.
相关问题
- 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
Or you can simply use the
LogManager.getCurrentLoggers()
to return a LoggerEnumeration
.Loop through it and set theLogger
's level by setLevel()to get the loggers use one of these
to set use this:
You could try something like:
Then iterate over allLoggers.