public static void main(String[] args) throws Exception {
List<String> logFiles = Arrays.asList("log4j2.xml", System.getenv("CC_LOG_CONFIG_FILE"));
logFiles.forEach(name -> {
if (name == null) return;
Path logFile = Paths.get(name);
if (Files.exists(logFile)) {
System.setProperty("log4j.configurationFile", logFile.toAbsolutePath().toString());
}
});
log = XLoggerFactory.getXLogger(Startup.class);
Thread.setDefaultUncaughtExceptionHandler((thread, throwable) -> {
// Normally the exceptions will be caught, but to debug any unexpected ones we log them (again).
log.error("Application-wide uncaught exception:", throwable);
System.exit(1);
});
log.info("Working dir: {}", new File("").getAbsolutePath());
Properties config = getProperties(args.length >= 1 ? args[0] : null);
GuiceContainer container = new GuiceContainer(config);
container.getInstance(RestApiServices.class).start();
container.getInstance(StateMachineService.class).initialize();
}
Startup.java 文件源码
java
阅读 36
收藏 0
点赞 0
评论 0
项目:clustercode
作者:
评论列表
文章目录