Skip to content

Commit 5ccaebd

Browse files
[Java] Handle if logging is not available on the Hub
1 parent 03bce95 commit 5ccaebd

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

java/server/src/org/openqa/selenium/grid/log/LoggingOptions.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,14 @@ public void configureLogging() {
165165
}
166166

167167
private OutputStream getOutputStream() throws FileNotFoundException {
168-
String fileName = config.get(LOGGING_SECTION, "log-file").get();
169-
FileOutputStream fileOut = null;
168+
String fileName = config.get(LOGGING_SECTION, "log-file").orElse("null");
169+
OutputStream fileOut = null;
170170
if (fileName != "null") {
171171
fileOut = new FileOutputStream(fileName);
172172
}
173+
if (fileOut == null) {
174+
fileOut = System.out;
175+
}
173176
return fileOut;
174177
}
175178
}

0 commit comments

Comments
 (0)