improve detection of which logging library to use, use slf4j if its the log4j jar file used (does not have setLevel method)
This commit is contained in:
parent
a488424404
commit
ffca91dda0
|
@ -32,7 +32,9 @@ public abstract class ESLoggerFactory {
|
|||
|
||||
static {
|
||||
try {
|
||||
Class.forName("org.apache.log4j.Logger");
|
||||
Class<?> loggerClazz = Class.forName("org.apache.log4j.Logger");
|
||||
// below will throw a NoSuchMethod failure with using slf4j log4j bridge
|
||||
loggerClazz.getMethod("setLevel", Class.forName("org.apache.log4j.Level"));
|
||||
defaultFactory = new Log4jESLoggerFactory();
|
||||
} catch (Throwable e) {
|
||||
// no log4j
|
||||
|
|
Loading…
Reference in New Issue