Note that there are some explanatory texts on larger screens.

plurals
  1. POChanging application context path leads to using different (unknown) logging configuration
    primarykey
    data
    text
    <p><strong>Setup:</strong> </p> <ul> <li>Tomcat 6.0.16</li> <li>Struts 2.1.6</li> <li>Apache Commons Logging 1.0.4</li> <li>Log4J 1.2.17</li> </ul> <p><strong>What I did:</strong></p> <p>Change in server.xml:</p> <pre><code>&lt;Context path="/" .../&gt;&lt;/Context&gt; </code></pre> <p>to</p> <pre><code>&lt;Context path="/shop" .../&gt;&lt;/Context&gt; </code></pre> <p><strong>The issues</strong></p> <p>Everything in the application is working fine (on the first glance). All links are correct and working etc.</p> <p>Now I discovered that the Loggers using Commons Logging (with Log4J) (usually the Loggers in Spring, Struts and OGNL) are using a different logger configuration than the default used before. Loggers using Log4J directly in the application are working fine with this configuration.</p> <p>For debugging purpose I have a JSP listing all the loggers with:</p> <pre><code>Logger.getRootLogger().getLoggerRepository( ).getCurrentLoggers() </code></pre> <p>But the "commons logging logger" are not listed anymore, although I could verify that they exist if I debug the code.</p> <p><strong>The question</strong></p> <ul> <li>How do I find the other configuration/root logger?</li> <li>Do I have to change anything in the struts configuration (or somewhere else) in relation to the context path change?</li> <li>Any ideas what the issue might be here?</li> </ul> <p><strong>Edit: I'm getting closer</strong></p> <p>The platform I am using is loading a minimal logging at start up. Before changing the context the advanced logging was loaded right afterwards and everything was fine. For some reason the listener of the web.xml (Spring initialization, etc.) is now running before the advanced logging is loaded. These classes are using the apache commons logging api and get loggers assigned basing on the simple root logger. Right afterwards the root logger is replace by the platform but the commons loggers are not updated with the new configuration. </p> <p>New question: As I stated below, changing anything in the platform is no option. <strong>So why did the listener run earlier when I change the context and how can I prevent this."</strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload