Skip to content
This repository has been archived by the owner on Jan 28, 2025. It is now read-only.

Commit

Permalink
Exit on startup failures (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
StrongestNumber9 authored Oct 23, 2023
1 parent 781be41 commit dd52620
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/com/teragrep/jla_02/JavaUtilLoggingLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,21 @@ public JavaUtilLoggingLogger() {
inputStream = new FileInputStream(System.getProperty("user.dir") + "/conf/logging.properties");
} catch (FileNotFoundException e) {
e.printStackTrace();
System.exit(1);
}
try {
LogManager.getLogManager().readConfiguration(inputStream);
}
catch (IOException e) {
System.out.println("Can't read conf/logging.properties: " + e.getMessage());
System.exit(1);
}
RelpHandler handler = null;
try {
handler = new RelpHandler();
} catch (NoSuchFieldException | IOException | TimeoutException | ClassNotFoundException | InstantiationException | IllegalAccessException e) {
e.printStackTrace();
System.exit(1);
}
LogManager.getLogManager().reset();
logger.addHandler(handler);
Expand Down

0 comments on commit dd52620

Please sign in to comment.