Peter Johnson wrote:You are using sl4j? I wonder if that has any bearing on this. Could you post a log entry of two. Perhaps slf4j is logging to stdout, and log4j is capturing that and posting it to the root appender. (The config you gave looks fine to me, pretty much matches what I have.)
hi Peter..
I got the problem and the solution..
We are using Jboss and Jboss clearly has log4j.jar in its lib folder.
As a result the users web application should not have log4j jar. If that jar is present, jboss issues errors while initialising log4j xml and is unable to initialise the appender.
As a result none of the appender is initialised and thus logging was not taking place.
The errors from log for your reference
2010-01-21 07:18:36,966 ERROR [STDERR] log4j:ERROR A "org.jboss.logging.appender.FileAppender" object is not assignable to a "org.apache.log4j.Appender" vari
able.
2010-01-21 07:18:36,966 ERROR [STDERR] log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
2010-01-21 07:18:36,966 ERROR [STDERR] log4j:ERROR [WebappClassLoader
delegate: false
repositories:
/WEB-INF/classes/
----------> Parent Classloader:
java.net.FactoryURLClassLoader@10747b4
] whereas object of type
2010-01-21 07:18:37,039 ERROR [STDERR] log4j:ERROR "org.jboss.logging.appender.FileAppender" was loaded by [org.jboss.system.server.NoAnnotationURLClassLoade
r@9505f].
2010-01-21 07:18:37,039 ERROR [STDERR] log4j:ERROR Could not instantiate appender named "FILE".