Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.17.2
-
None
Description
The current implementation of ApiLogger::setLevel is to throw an UnsupportedOperation Exception.
It turns out that Gradle's internal logging tries to call this method under some configurations, and it cannot deal gracefully with that Exception, so the build fails.
mattsicker I was wondering if there is any reason why the implementation could not be like this:
@Override public void setLevel(final Level newLevel) throws SecurityException { doSetLevel(newLevel); Configurator.setLevel(logger, LevelTranslator.toLevel(newLevel)); }
I will try this in a test project.
(5 minutes later...) Looking at LOG4J2-1110, I understand that this can be done in CoreLogger but not in ApiLogger.
Still, would it be possible to silently ignore this call to setLevel, rather than throwing an UnsupportedOperationException?
Attachments
Issue Links
- relates to
-
LOG4J2-1110 org.apache.logging.log4j.jul.CoreLogger.setLevel() checks for security permission too late
- Closed
- links to