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 {
|
static {
|
||||||
try {
|
try {
|
||||||
Class.forName("org.slf4j.Logger");
|
Class.forName("org.apache.log4j.Logger");
|
||||||
defaultFactory = new Slf4jESLoggerFactory();
|
defaultFactory = new Log4jESLoggerFactory();
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
// no slf4j
|
// no log4j
|
||||||
try {
|
try {
|
||||||
Class.forName("org.apache.log4j.Logger");
|
Class.forName("org.slf4j.Logger");
|
||||||
defaultFactory = new Log4jESLoggerFactory();
|
defaultFactory = new Slf4jESLoggerFactory();
|
||||||
} catch (Throwable e1) {
|
} catch (Throwable e1) {
|
||||||
// no log4j
|
// no slf4j
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue