Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I saw several questions on the topic, but since they are rather related to errors I don't think this is a duplicate.

My problem is that I can't get any logging out of a .war I'm deploying on JBoss 6 EAP, there are no errors logged also however. There is also a file named as my .war created under the /log folder in JBoss, but it is also empty.

The .war deploys fine and works. Since I'm using Spring I can't even see it initializing it's contexts.

Logging works perfectly under Tomcat 7 with the same .war.

I have created a log4j.xml and placed it in my WEB-INF/classes dir (I also tried in /WEB-INF):

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
  <appender name="console" class="org.apache.log4j.ConsoleAppender"> 
    <param name="Target" value="System.out"/> 
    <layout class="org.apache.log4j.PatternLayout"> 
      <param name="ConversionPattern" value="%-5p %c{1} - %m%n"/> 
    </layout> 
  </appender> 

  <root> 
    <priority value ="info" /> 
    <appender-ref ref="console" /> 
  </root>

</log4j:configuration>

I'm using log4j 1.2.17, Spring 3.1 and JBoss 6 EAP.

Any help greatly appreciated, Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
386 views
Welcome To Ask or Share your Answers For Others

1 Answer

Unlike JBoss AS 7.1.1, JBoss EAP 6 activates per-deployment logging configuration if it finds a logging config file: https://community.jboss.org/message/776182#776182

I suggest removing log4j.xml. If that doesn't help, modify your jboss configuration to set the system property org.jboss.as.logging.per-deployment to false. In my case, I had to add this line to standalone.conf:

JAVA_OPTS="$JAVA_OPTS -Dorg.jboss.as.logging.per-deployment=false"

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...