JBoss Community

Re: AS7 Logging - org.jboss.logging.jul-to-slf4j-stub ?

created by Patrick Ruckstuhl in JBoss AS 7 Development - View the full discussion

rang s wrote:

 

( I have specified this handled in logging.properties bundled in ejb jar, hope this is the right way) .

 

I have tried adding log4j.properties in the ejb jar but the messages were not logged.

If you have both a logging.properties and a log4j.properties, I believe the log4j.properties will be ignored.  You can only have one logging configuration file per deployment, and that configuration applies to all logging APIs, including slf4j, JUL, log4j, etc.  AS automatically unifies all log frameworks.

 

This doesn't seem to work for me.

 

If I create the file

 

my.ear/META-INF/log4j.properties

 

with

 

log4j.rootLogger=DEBUG, FA

 

log4j.appender.FA=org.apache.log4j.FileAppender

log4j.appender.FA.File=/tmp/my.log

log4j.appender.FA.layout=org.apache.log4j.PatternLayout

log4j.appender.FA.layout.ConversionPattern= %-4r [%t] %-5p %c %x - %m%n

 

 

this results in nothing in the server.log and an empty /tmp/my.log

 

 

but if I create a

 

my.ear/META-INF/logging.properties

 

this results in everything beeing logged to /tmp/my.log

 

 

We're using SLF4J in our application and also using a library that uses COMMONS-LOGGING

Reply to this message by going to Community

Start a new discussion in JBoss AS 7 Development at Community