how to free the logger instance in the loggerCache

24 Aug
2016
24 Aug
'16
9:40 a.m.
I saw the loggerCache in class LoggerContext is a ConcurrentHashMap, how to free the instance in it.

24 Aug
24 Aug
6:57 p.m.
New subject: how to free the logger instance in the loggerCache
I saw the loggerCache in class LoggerContext is a ConcurrentHashMap, how to free the instance in it.
There doesn’t seem to be a way to clear the cache. Normally this is not a problem as there is a finite, and small, number of loggers in any application. What are you trying to do? And why? You could suggest a change to logback. Or you could use an ugly reflection hack. You can change the loggerCache field to public via reflection, then you can get it and clear the entries. But bewarned this could easily cause problems if you upgrade logback later and don’t test properly. -- David
3327
Age (days ago)
3327
Last active (days ago)
1 comments
2 participants
participants (2)
-
David Roussel
-
Zhenyi Zhao