This is an automated email from the ASF dual-hosted git repository.

rpopma pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit 61e74bcbeb48cd06a33e29a1e7e73639e36fcba6
Author: Remko Popma <rem...@yahoo.com>
AuthorDate: Thu Apr 14 19:37:34 2022 +0900

    LOG4J2-3476 ignore JUL ApiLogger.setLevel without error
---
 log4j-jul/src/main/java/org/apache/logging/log4j/jul/ApiLogger.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/log4j-jul/src/main/java/org/apache/logging/log4j/jul/ApiLogger.java 
b/log4j-jul/src/main/java/org/apache/logging/log4j/jul/ApiLogger.java
index 96512e670c..f4ac095155 100644
--- a/log4j-jul/src/main/java/org/apache/logging/log4j/jul/ApiLogger.java
+++ b/log4j-jul/src/main/java/org/apache/logging/log4j/jul/ApiLogger.java
@@ -27,6 +27,7 @@ import java.util.logging.Logger;
 import org.apache.logging.log4j.message.Message;
 import org.apache.logging.log4j.message.MessageFactory;
 import org.apache.logging.log4j.spi.ExtendedLogger;
+import org.apache.logging.log4j.status.StatusLogger;
 
 /**
  * Log4j API implementation of the JUL {@link Logger} class. <strong>Note that 
this implementation does
@@ -94,7 +95,8 @@ public class ApiLogger extends Logger {
 
     @Override
     public void setLevel(final Level newLevel) throws SecurityException {
-        throw new UnsupportedOperationException("Cannot set level through 
log4j-api");
+        StatusLogger.getLogger().error("Cannot set JUL log level through 
log4j-api: " +
+                "ignoring call to Logger.setLevel(" + newLevel + ")");
     }
 
     /**

Reply via email to