if (formatter instanceof SimpleFormatter) {
/* DGF Nobody likes the SimpleFormatter; surely they
* wanted our terse formatter instead.
* Furthermore, we all want DEBUG/INFO on stdout and WARN/ERROR on stderr */
Level originalLevel = handler.getLevel();
handler.setFormatter(new TerseFormatter(false));
handler.setLevel(Level.WARNING);
StdOutHandler stdOutHandler = new StdOutHandler();
stdOutHandler.setFormatter(new TerseFormatter(false));
stdOutHandler.setFilter(new MaxLevelFilter(Level.INFO));
stdOutHandler.setLevel(originalLevel);
logger.addHandler(stdOutHandler);
if (isDebugMode()) {
if (originalLevel.intValue() > Level.FINE.intValue()) {
stdOutHandler.setLevel(Level.FINE);
}
}
}
}
}
if (isDebugMode()) {
logger.setLevel(Level.FINE);
}
log = LogFactory.getLog(SeleniumServer.class);
if (logOutFileName==null && System.getProperty("selenium.log")!=null) {
logOutFileName = System.getProperty("selenium.log");
}
if (logOutFileName!=null) {
try {
File logFile = new File(logOutFileName);
FileHandler fileHandler = seleniumFileHandlers.get(logFile);
if (fileHandler == null) {
fileHandler = new FileHandler(logFile.getAbsolutePath());
seleniumFileHandlers.put(logFile, fileHandler);
}
fileHandler.setFormatter(new TerseFormatter(true));
logger.setLevel(Level.FINE);
fileHandler.setLevel(Level.FINE);
logger.addHandler(fileHandler);
log.info("Writing debug logs to " + logFile.getAbsolutePath());
} catch (IOException e) {