I am using a WebApplicationInitializer so try to set the logback/context-name env-entry in Java code. I have tried the following in the onStartup method:
InitialContext initialContext = new InitialContext(); initialContext.addToEnvironment("logback/context-name", "mycontext");
I see logback is trying to get the contextName in ContextJNDISelector.getLoggerContext(). Unfortunately the lookup returns null even though I can see the "logback/context-name" entry in ctx.getEnvironment()
What's the correct way to add the context-name to IntialContext?