Skip to content

Commit 07f6920

Browse files
committed
Workaround for the missing JMX infrastructure
1 parent b5a633a commit 07f6920

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package java.lang.management;
2+
3+
import java.util.Collections;
4+
5+
// FIXME Remove this once 2.24.0 is released
6+
// https://github.com/apache/logging-log4j2/issues/2774#issuecomment-2254418643
7+
public class ManagementFactory {
8+
public static java.lang.management.RuntimeMXBean getRuntimeMXBean() {
9+
return Collections::emptyList;
10+
}
11+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package java.lang.management;
2+
3+
import java.util.List;
4+
5+
// FIXME Remove this once 2.24.0 is released
6+
// https://github.com/apache/logging-log4j2/issues/2774#issuecomment-2254418643
7+
public interface RuntimeMXBean {
8+
public List<String> getInputArguments();
9+
}

library/src/main/java/net/loune/log4j2android/AndroidLog4jHelper.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ public class AndroidLog4jHelper {
2222
savedContext = new ContextProxy();
2323

2424
System.setProperty("Log4jContextSelector", "net.loune.log4j2android.AndroidContextSelector");
25+
// FIXME Remove this once 2.24.0 is released
26+
// https://github.com/apache/logging-log4j2/issues/2774#issuecomment-2254418643
2527
System.setProperty("log4j2.disable.jmx", "true");
2628

2729
injectPlugins("net.loune.log4j2android", AndroidLookup.class, LogcatAppender.class);

0 commit comments

Comments
 (0)