Note that there are some explanatory texts on larger screens.

plurals
  1. POWebSphere, Log4j and SpringMVC
    primarykey
    data
    text
    <p>When the servers starts up, I see all the correct log4j configuration in the console. However, I don't see any log messages from spring framework.</p> <p>Also, I added some code that outputs defined loggers, and I see that my spring logger is defined. Why don't I see any log messages from spring?</p> <pre><code>Enumeration loggers = Logger.getDefaultHierarchy().getCurrentLoggers(); while( loggers.hasMoreElements()){ Logger logger = (Logger) loggers.nextElement(); System.out.println(logger.getName()+","+logger.getLevel()); } SystemOut O org.springframework,DEBUG </code></pre> <p>My web.xml is (log4j/spring section):</p> <pre><code>&lt;context-param&gt; &lt;param-name&gt;log4jConfigLocation&lt;/param-name&gt; &lt;param-value&gt;/WEB-INF/resource/log4j.xml&lt;/param-value&gt; &lt;/context-param&gt; &lt;listener&gt; &lt;listener-class&gt;org.springframework.web.util.Log4jConfigListener&lt;/listener-class&gt; &lt;/listener&gt; </code></pre> <p>My log4j.xml is:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt; &lt;!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"&gt; &lt;log4j:configuration debug="true" xmlns:log4j="http://jakarta.apache.org/log4j/"&gt; &lt;appender name="ConsoleAppender" class="org.apache.log4j.ConsoleAppender"&gt; &lt;layout class="org.apache.log4j.PatternLayout"&gt; &lt;param name="conversionPattern" value="%5p %d %C{1} - %m%n" /&gt; &lt;/layout&gt; &lt;/appender&gt; &lt;!-- Loggers to filter out various class paths --&gt; &lt;logger name="org.springframework" additivity="false"&gt; &lt;level value="debug"/&gt; &lt;appender-ref ref="ConsoleAppender" /&gt; &lt;/logger&gt; &lt;/log4j:configuration&gt; </code></pre> <p>Here's what I see in the console:</p> <pre><code>SystemOut O log4j: System property is :null SystemOut O log4j: Standard DocumentBuilderFactory search succeded. SystemOut O log4j: DocumentBuilderFactory is: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl SystemOut O log4j: debug attribute= "true". SystemOut O log4j: Threshold ="null". SystemOut O log4j: Retreiving an instance of org.apache.log4j.Logger. SystemOut O log4j: Setting [org.springframework] additivity to [false]. SystemOut O log4j: Level value for org.springframework is [debug]. SystemOut O log4j: org.springframework level set to DEBUG SystemOut O log4j: Class name: [org.apache.log4j.ConsoleAppender] SystemOut O log4j: Setting property [target] to [System.Out]. SystemOut O log4j: Setting property [threshold] to [DEBUG]. SystemOut O log4j: Parsing layout of class: "org.apache.log4j.PatternLayout" SystemOut O log4j: Setting property [conversionPattern] to [%5p %d %C{1} - %m%n]. SystemOut O log4j: Adding appender named [ConsoleAppender] to category [org.springframework]. SystemOut O log4j: Level value for root is [debug]. SystemOut O log4j: root level set to DEBUG SystemOut O log4j: Adding appender named [ConsoleAppender] to category [root]. </code></pre> <p>Things I've tried:</p> <p>1) An accepted answer from <a href="https://stackoverflow.com/questions/13828582/how-to-set-log4j-configuration-system-variable-in-websphere-7">this post</a></p> <p>2) I removed a lot of jars that I thought might interfere with log4j.</p> <ul> <li>I replaced slf4j-jdk.jar with slf4j-log4j.jar</li> </ul> <p>3) Adding springs log4j listener to web.xml (also tried log4jInitialization bean in appcontext.xml)</p>
    singulars
    1. This table or related slice is empty.
    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