Skip to content

Commit

Permalink
禁用Log4j2查询器
Browse files Browse the repository at this point in the history
  • Loading branch information
Luohuayu committed Dec 9, 2021
1 parent ed198c1 commit 50610c7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/catserver/server/CatServerLaunch.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
public class CatServerLaunch {
public static void main(String[] args) throws Throwable {
checkJavaVersion();
disableLog4j2Lookup();
if (!"true".equals(System.getProperty("catserver.skipCheckLibraries"))) LibrariesManager.checkLibraries();
Class.forName("net.minecraftforge.fml.relauncher.ServerLaunchWrapper").getDeclaredMethod("main", String[].class).invoke(null, new Object[] { args });
}
Expand All @@ -26,4 +27,8 @@ public static void checkJavaVersion() {
}
}
}

public static void disableLog4j2Lookup() {
System.setProperty("log4j2.formatMsgNoLookups", "true");
}
}

0 comments on commit 50610c7

Please sign in to comment.