Skip to content

Commit

Permalink
IGNITE-23472 Fix GridTestLog4jLogger
Browse files Browse the repository at this point in the history
  • Loading branch information
chesnokoff committed Nov 5, 2024
1 parent 30222f0 commit 0e1af24
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,19 @@ public GridTestLog4jLogger(final URL cfgUrl) throws IgniteCheckedException {
quiet = quiet0;
}

private GridTestLog4jLogger(final Logger impl, String cfg) {
assert impl != null;

addConsoleAppenderIfNeeded(null, new C1<Boolean, Logger>() {
@Override public Logger apply(Boolean init) {
return impl;
}
});

quiet = quiet0;
this.cfg = cfg;
}

/**
* Checks if Log4j is already configured within this VM or not.
*
Expand Down Expand Up @@ -489,7 +502,7 @@ public static Collection<String> logFiles() {
? LogManager.getRootLogger()
: ctgr instanceof Class
? LogManager.getLogger(((Class<?>)ctgr).getName())
: LogManager.getLogger(ctgr.toString()));
: LogManager.getLogger(ctgr.toString()), cfg);
}

/** {@inheritDoc} */
Expand Down

0 comments on commit 0e1af24

Please sign in to comment.