I have a JavaEE/JBoss project. I am having problem configuring JBoss to log using log4j.
This is my log4j.properties under /main/reasources/
log4j.rootLogger=stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p %c %n%m%C
I also added the jboss-deployment-structure
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<exclusions>
<module name="org.apache.log4j"/>
<module name="org.apache.commons.logging"/>
</exclusions>
</deployment>
</jboss-deployment-structure>
I added this line at the oned of standalone.conf that is located under /jboss-eap-6.2/bin
JAVA_OPTS="$JAVA_OPTS -Dorg.jboss.as.logging.per-deployment=true"
I have the dependencies on pom.xml too:
<dependencies>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-web-6.0</artifactId>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
When I run the application, the logging is coming from the default JBoss logging configuration. I cannot change the message format. I also need to log to a syslog server.