Java Logging: Automatically default to log4j before slf4j logging if log4j in the classpath, closes #1265.
This commit is contained in:
parent
779dc4309b
commit
a83c45be22
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue