Log4j does not register anything under JBoss 6 EAP

I saw several questions on this topic, but since they are more likely to be related to errors, I do not think this is a duplicate.

My problem is that I cannot get any output from the .war that I am deploying to JBoss 6 EAP, however no errors have been reported. There is also a file called my .war created in the / log folder in JBoss, but it is also empty.

The .war deployment works fine and works. Since I use Spring, I don’t even see it initializing its contexts.

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

I created the log4j.xml file and placed it in my WEB-INF / classes directory (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 am using log4j 1.2.17, Spring 3.1 and JBoss 6 EAP.

Any help is much appreciated, Thanks

+7
source share
2 answers

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

I suggest removing log4j.xml . If this does not help, change the 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" 
+19
source

In my case, EAP 6.0 in domain mode, I had to set org.jboss.as.logging.per-deployment = false as an environment property for a specific server. Setting it as a "system property", as indicated in the EAP 6.3 documents, did not work.

+3
source

All Articles