vy commented on code in PR #3071:
URL: https://github.com/apache/logging-log4j2/pull/3071#discussion_r1793523300


##########
log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/JmxRuntimeInputArgumentsLookup.java:
##########
@@ -31,17 +34,16 @@
 @Plugin(name = "jvmrunargs", category = StrLookup.CATEGORY)
 public class JmxRuntimeInputArgumentsLookup extends MapLookup {
 
-    static {
-        final List<String> argsList = 
ManagementFactory.getRuntimeMXBean().getInputArguments();
-        JMX_SINGLETON = new 
JmxRuntimeInputArgumentsLookup(MapLookup.toMap(argsList));
-    }
+    private static final Logger LOGGER = StatusLogger.getLogger();
 
-    public static final JmxRuntimeInputArgumentsLookup JMX_SINGLETON;
+    public static final JmxRuntimeInputArgumentsLookup JMX_SINGLETON = new 
JmxRuntimeInputArgumentsLookup();
 
     /**
      * Constructor when used directly as a plugin.
      */
-    public JmxRuntimeInputArgumentsLookup() {}
+    public JmxRuntimeInputArgumentsLookup() {

Review Comment:
   *Nit:* Can't we instead have a `@PluginFactory` returning the singleton 
instance?



-- 
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: notifications-unsubscr...@logging.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to