The application I'm working on provides logging based on the current user. To achieve this I use the log4j AbstractFilter
which checks if there is a custom log level for the current user and returns the appropriate result for methods such as Log.isDebugEnabled()
etc.
Some third party libraries used by my application use java.util.logging
. I would like to have those log the same way my own logging does. But the java.util.logging.Logger.isLoggable()
method returns different results than my own logging. Is there some way to overwrite this function with my own logic?
Edit: I use slf4j
in my application with log4j2
as the underlying logging framework. I tried to use the java.util.logging ~> slf4j bridge as described here, but it seems only to affect the Log
function itself, not the isLoggable()
.