Adjust to logger API changes in Elasticsearch

Previously core Elasticsearch had methods in a test class for removing
and adding appenders. However, these methods were moved to production
code. This commit adjusts x-plugins for this change.

Original commit: elastic/x-pack-elasticsearch@83e37ef65a
This commit is contained in:
Jason Tedor 2016-09-09 09:14:16 -04:00
parent b74f1e6cb2
commit 592ca5ab7b
1 changed files with 1 additions and 2 deletions

View File

@ -16,7 +16,6 @@ import org.apache.logging.log4j.core.config.LoggerConfig;
import org.apache.logging.log4j.core.filter.RegexFilter;
import org.elasticsearch.common.logging.ESLoggerFactory;
import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.logging.TestLoggers;
import java.util.ArrayList;
import java.util.List;
@ -28,7 +27,7 @@ public class CapturingLogger {
final String name = caller.getClassName() + "." + caller.getMethodName() + "." + level.toString();
final Logger logger = ESLoggerFactory.getLogger(name);
Loggers.setLevel(logger, level);
TestLoggers.addAppender(logger, new MockAppender(name));
Loggers.addAppender(logger, new MockAppender(name));
return logger;
}