[slf4j-user] context-name in WebApplicationInitializer
Robert .
robert.discussions at gmail.com
Thu Oct 27 11:48:45 UTC 2016
I'm trying to set the context-name for each web application to try to
separate logging per web application as documented in
http://logback.qos.ch/manual/loggingSeparation.html
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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20161027/e1ea4822/attachment.html>
More information about the slf4j-user
mailing list