Java Logging: Automatically default to log4j before slf4j logging if log4j in the classpath, closes #1265.

This commit is contained in:
Shay Banon 2011-08-20 03:27:29 +03:00
parent 779dc4309b
commit a83c45be22
1 changed files with 6 additions and 6 deletions

View File

@ -32,15 +32,15 @@ public abstract class ESLoggerFactory {
static {
try {
Class.forName("org.slf4j.Logger");
defaultFactory = new Slf4jESLoggerFactory();
Class.forName("org.apache.log4j.Logger");
defaultFactory = new Log4jESLoggerFactory();
} catch (Throwable e) {
// no slf4j
// no log4j
try {
Class.forName("org.apache.log4j.Logger");
defaultFactory = new Log4jESLoggerFactory();
Class.forName("org.slf4j.Logger");
defaultFactory = new Slf4jESLoggerFactory();
} catch (Throwable e1) {
// no log4j
// no slf4j
}
}
}