garydgregory commented on issue #2353:
URL: 
https://github.com/apache/logging-log4j2/issues/2353#issuecomment-1985847802

   Hi All,
   
   After discussing this with @ppkarwasz and looking at code, we are dealing 
with the following issue:
   
   1. During app startup, some call site (your app, a library, or the JRE) 
calls JUL's `Logger.setLevel()`
   2. This overrides what your Log4j 2 configuration defines, and you do not 
want that behavior.
   
   To keep the Log4j configuration pristine, I think we should:
   
   1. Remove auto-detection in our JUL module
   3. This will allow `org.apache.logging.log4j.jul.ApiLoggerAdapter` to kick 
in instead of `org.apache.logging.log4j.jul.CoreLoggerAdapter`
   4. If you want the old behavior back, you can set the 
`log4j2.julLoggerAdapter` Java system property to 
`org.apache.logging.log4j.jul.ApiLoggerAdapter`
   5. The call to `Logger.setLevel()` turns into a noop
   5. The call to `Logger.getLevel()` should return the configured level, not 
the effective level.
   
   @ppkarwasz Check?
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to