[Java] Handle if logging is not available on the Hub
@@ -165,11 +165,14 @@ public void configureLogging() {
}
private OutputStream getOutputStream() throws FileNotFoundException {
- String fileName = config.get(LOGGING_SECTION, "log-file").get();
- FileOutputStream fileOut = null;
+ String fileName = config.get(LOGGING_SECTION, "log-file").orElse("null");
+ OutputStream fileOut = null;
if (fileName != "null") {
fileOut = new FileOutputStream(fileName);
}
+ if (fileOut == null) {
+ fileOut = System.out;
+ }
return fileOut;
}
}
