diff --git a/src/main/java/org/elasticsearch/common/logging/Loggers.java b/src/main/java/org/elasticsearch/common/logging/Loggers.java index 7d1899031d9..665f68803f7 100644 --- a/src/main/java/org/elasticsearch/common/logging/Loggers.java +++ b/src/main/java/org/elasticsearch/common/logging/Loggers.java @@ -110,7 +110,7 @@ public class Loggers { } public static ESLogger getLogger(String s) { - return ESLoggerFactory.getLogger(s); + return ESLoggerFactory.getLogger(getLoggerName(s)); } public static ESLogger getLogger(Class clazz) { diff --git a/src/test/java/org/elasticsearch/junit/listeners/LoggingListener.java b/src/test/java/org/elasticsearch/junit/listeners/LoggingListener.java index 5a9faf4bec5..af9bfcca91e 100644 --- a/src/test/java/org/elasticsearch/junit/listeners/LoggingListener.java +++ b/src/test/java/org/elasticsearch/junit/listeners/LoggingListener.java @@ -20,6 +20,7 @@ package org.elasticsearch.junit.listeners; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.ESLoggerFactory; +import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.junit.annotations.TestLogging; import org.junit.runner.Description; import org.junit.runner.notification.RunListener; @@ -75,6 +76,6 @@ public class LoggingListener extends RunListener { if (loggerName.equalsIgnoreCase("_root")) { return ESLoggerFactory.getRootLogger(); } - return ESLoggerFactory.getLogger(loggerName); + return Loggers.getLogger(loggerName); } }