<div dir="ltr">I have 2 webapps, each with their own maven dependencies of slf4j and logback-classic declared, deployed to tomcat6. Each webapp writes to their own log file. Works beautifully.<div><br></div><div>However, when deployed to a production tomcat6 configured with logback-access, the webapp logback configs do not appear to be read and the log files are not created.</div><div><br></div><div>If I add code to the contextInitialized() of my ServletContextListener like the one found here:</div><div><a href="http://logback.qos.ch/manual/configuration.html#joranDirectly">http://logback.qos.ch/manual/configuration.html#joranDirectly</a><br></div><div>the log files are created for both webapps, but then log messages from both webapps are written to only one of the log files.</div><div><br></div><div>I also found that if I add <contextName>WEBAPP_NAME<contextName> to the logback config files of each webapp, where WEBAPP_NAME = unique name for the given webapp, an error message pops up when deploying the 2nd webapp saying something like "<span style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:19.5px">the context name has already been set to appA".</span></div><div><span style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:19.5px"><br></span></div><div><span style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:19.5px">This leads me to believe that both apps are sharing the same Logger Context, as described here:</span></div><div><a href="http://logback.qos.ch/manual/loggingSeparation.html">http://logback.qos.ch/manual/loggingSeparation.html</a><br></div><div><br></div><div>I followed the steps to enable ContextJNDISelector, and it does now work. Each webapp is logging to their respective log file.</div><div><br></div><div><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:19.5px">However, there are a large number of other webapps that are deployed to the same environment, and I am unsure of the impact enabling ContextJNDISelector might have on them.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:19.5px">My question is, is something like ContextJNDISelector necessary on an environment using logback access? Or should I be able to simply include the necessary maven dependencies in appA and appB, and perhaps missed something small along the way? Shouldn't tomcat's child-first class loading allow me to do so?</p></div></div>