Commit 5aa2163c authored by Gary Gregory's avatar Gary Gregory
Browse files

[LOG4J2-1987] Log4J JUL Bridge and RMI Security Manager causes access

denied ("java.util.logging.LoggingPermission" "control")
parent 8ca5826e
Showing with 14 additions and 1 deletion
+14 -1
......@@ -17,6 +17,8 @@
package org.apache.logging.log4j.jul;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.logging.Filter;
import java.util.logging.Level;
import java.util.logging.LogRecord;
......@@ -47,7 +49,15 @@ public class ApiLogger extends Logger {
ApiLogger(final ExtendedLogger logger) {
super(logger.getName(), null);
super.setLevel(LevelTranslator.toJavaLevel(logger.getLevel()));
final Level javaLevel = LevelTranslator.toJavaLevel(logger.getLevel());
// "java.util.logging.LoggingPermission" "control"
AccessController.doPrivileged(new PrivilegedAction<Object>() {
@Override
public Object run() {
ApiLogger.super.setLevel(javaLevel);
return null;
}
});
this.logger = new WrappedLogger(logger);
}
......
......@@ -43,6 +43,9 @@
<action issue="LOG4J2-1971" dev="rgoers" type="fix">
Register log4j-core as an OSGi service. Skip tests for LOG4J2-1766 on MacOS. Use group "staff" for LOG4J2-1699 test on MacOS.
</action>
<action issue="LOG4J2-1987" dev="ggregory" type="fix" due-to="Andreas Felder">
Log4J JUL Bridge and RMI Security Manager causes access denied ("java.util.logging.LoggingPermission" "control")
</action>
<action issue="LOG4J2-1982" dev="ggregory" type="fix" due-to="Christoph Lembeck">
Log4j-config.xsd only allows one AppenderRef element for each Logger element.
</action>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment