Java – number of recorders used
•
Java
I am working with a very large Java application using log4j, and I wonder if there is a way to extract the number of active recorders at run time? Or what are the existing recorders in the application?
Solution
You can try something similar:
Enumeration allLoggers = Logger.getRootLogger() .getLoggerRepository() .getCurrentLoggers();
Then iterate through allloggers
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码