Java PhantomJSDriver disable all logs in console
问题 I'm developing a small console app using Selenium and I need to turn off all logs from it. I have tried phantomJSDriver.setLogLevel(Level.OFF); but it does not work. I need help. How do I disable all logs in console application that is using Selenium and Phantomjs (GhostDriver)? 回答1: PhantomJSDriverService service = new PhantomJSDriverService.Builder() .usingPhantomJSExecutable(new File(VariableClass.phantomjs_file_path)) .withLogFile(null) .build(); 回答2: This one works for me.