Skip to content

Commit

Permalink
Port JndiContextSelector bit from main
Browse files Browse the repository at this point in the history
  • Loading branch information
vy committed Jan 10, 2024
1 parent d1e41d2 commit cf4b39e
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,12 @@ public LoggerContext getContext(
return lc;
}

String loggingContextName = null;

try (final JndiManager jndiManager = JndiManager.getDefaultManager()) {
loggingContextName = jndiManager.lookup(Constants.JNDI_CONTEXT_NAME);
} catch (final NamingException ne) {
LOGGER.error("Unable to lookup {}", Constants.JNDI_CONTEXT_NAME, ne);
}
String loggingContextName = getContextName();

return loggingContextName == null ? CONTEXT : locateContext(loggingContextName, null, configLocation);
}

private String getContextName() {
private static String getContextName() {
String loggingContextName = null;

try (final JndiManager jndiManager = JndiManager.getDefaultManager()) {
Expand Down

0 comments on commit cf4b39e

Please sign in to comment.