Skip to content

Commit

Permalink
Initialize ES logging api for tests (#88022)
Browse files Browse the repository at this point in the history
This commit adds initialization of the new ES logging api into
ESTestCase, so that tests can begin using the new logging api.
  • Loading branch information
rjernst authored Jun 24, 2022
1 parent 71ab4c4 commit f17f260
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public static void configure(final Environment environment, boolean useConsole)
configure(environment.settings(), environment.configFile(), environment.logsFile(), useConsole);
}

private static void configureESLogging() {
public static void configureESLogging() {
LoggerFactory.setInstance(new LoggerFactoryImpl());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@ public static void resetPortCounter() {
static {
TEST_WORKER_VM_ID = System.getProperty(TEST_WORKER_SYS_PROPERTY, DEFAULT_TEST_WORKER_ID);
setTestSysProps();
// TODO: consolidate logging initialization for tests so it all occurs in logconfigurator
LogConfigurator.loadLog4jPlugins();
LogConfigurator.configureESLogging();

for (String leakLoggerName : Arrays.asList("io.netty.util.ResourceLeakDetector", LeakTracker.class.getName())) {
Logger leakLogger = LogManager.getLogger(leakLoggerName);
Expand Down

0 comments on commit f17f260

Please sign in to comment.