[英]Initialize VM arguments to the static variable
I am working on the JUL - Log4j 1.x bridge.我正在 JUL - Log4j 1.x 桥上工作。 I was follow this steps https://stackoverflow.com/a/4318607 .
我按照这个步骤https://stackoverflow.com/a/4318607 。 Everything work fine, when I using VM argument:
当我使用 VM 参数时,一切正常:
-Djava.util.logging.manager=org.apache.logging.julbridge.JULBridgeLogManager
But I can't using VM arguments, it is some way how to set this classpath like static variable?但我不能使用 VM arguments,它是如何设置这个类路径的某种方式,如 static 变量? For in exmple in Main.class
例如 Main.class
Or somehow set java.util.logging.manager (LogManager class) to JULBridgeLogManager或者以某种方式将 java.util.logging.manager (LogManager 类)设置为 JULBridgeLogManager
I used in Main class static block and delete VM arguments and that worked well:我在 Main class static 中使用块和删除 VM arguments 并且效果很好:
static {
System.setProperty("java.util.logging.manager", "org.apache.logging.julbridge.JULBridgeLogManager");
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.