[英]Initialize VM arguments to the static variable
我正在 JUL - Log4j 1.x 橋上工作。 我按照這個步驟https://stackoverflow.com/a/4318607 。 當我使用 VM 參數時,一切正常:
-Djava.util.logging.manager=org.apache.logging.julbridge.JULBridgeLogManager
但我不能使用 VM arguments,它是如何設置這個類路徑的某種方式,如 static 變量? 例如 Main.class
或者以某種方式將 java.util.logging.manager (LogManager 類)設置為 JULBridgeLogManager
我在 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.