[java] add support for appendLog to msedgedriver service
*/
public static final String EDGE_DRIVER_LOG_LEVEL_PROPERTY = "webdriver.edge.loglevel";
+ /**
+ * Boolean system property that defines whether MSEdgeDriver should append to existing log file.
+ */
+ public static final String EDGE_DRIVER_APPEND_LOG_PROPERTY = "webdriver.edge.appendLog";
+
/**
* Boolean system property that defines whether the MicrosoftWebDriver executable should be started
* with verbose logging.
@@ -118,6 +123,7 @@ public static EdgeDriverService createDefaultService() {
EdgeDriverService, EdgeDriverService.Builder> {
private final boolean disableBuildCheck = Boolean.getBoolean(EDGE_DRIVER_DISABLE_BUILD_CHECK);
+ private boolean appendLog = Boolean.getBoolean(EDGE_DRIVER_APPEND_LOG_PROPERTY);
private boolean verbose = Boolean.getBoolean(EDGE_DRIVER_VERBOSE_LOG_PROPERTY);
private String logLevel = System.getProperty(EDGE_DRIVER_LOG_LEVEL_PROPERTY);
private boolean silent = Boolean.getBoolean(EDGE_DRIVER_SILENT_OUTPUT_PROPERTY);
@@ -143,6 +149,17 @@ public int score(Capabilities capabilities) {
return score;
}
+ /**
+ * Configures the driver server appending to log file.
+ *
+ * @param appendLog True for appending to log file, false otherwise.
+ * @return A self reference.
+ */
+ public EdgeDriverService.Builder withAppendLog(boolean appendLog) {
+ this.appendLog = appendLog;
+ return this;
+ }
+
/**
* Configures the driver server verbosity.
*
@@ -223,6 +240,9 @@ protected File findDefaultExecutable() {
if (getLogFile() != null) {
args.add(String.format("--log-path=%s", getLogFile().getAbsolutePath()));
}
+ if (appendLog) {
+ args.add("--append-log");
+ }
if (logLevel != null) {
args.add(String.format("--log-level=%s", logLevel));
}
