Log4J warning message on start of the Application server

Hi ,

I am using JSF for my web application. I am also using log4J for logging purpose. As soon as i request my home page i get the following warning message:

log4j:WARN No appenders could be found for logger (com.sun.faces.config.Configur

eListener).

log4j:WARN Please initialize the log4j system properly.

Here is my log4j.properties file which i have put in the applications classpath.

# Set root logger level to DEBUG and its only appender to A1.

log4j.rootLogger=DEBUG, A1

# A1 is set to be a ConsoleAppender.

log4j.appender.A1=org.apache.log4j.ConsoleAppender

# A1 uses PatternLayout.

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

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

I am setting up the console appender to the root logger and the appender is using PatternLayout.

Can any one help please ?

[930 byte] By [subhrajyotia] at [2007-10-2 20:47:18]
# 1

You need to put log4j.properties on the src folder in order to be copied when you build the project.

This is my log4j.properties

log4j.rootLogger=debug, R

log4j.appender.R=org.apache.log4j.RollingFileAppender

log4j.appender.R.File=r:/logs/root.log

#log4j.appender.R.DatePattern='.'yyyy-MM-dd

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

log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

log4j.logger.pt.ivv.common.helpers.logging.IvvGeneralLogger=debug, commonAppender

log4j.additivity.pt.ivv.common.helpers.logging.IvvGeneralLogger=false

log4j.appender.commonAppender=org.apache.log4j.RollingFileAppender

log4j.appender.commonAppender.File=r:/logs/generalCommon.log

#log4j.appender.commonAppender.DatePattern='.'yyyy-MM-dd

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

log4j.appender.commonAppender.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

pringia at 2007-7-13 23:31:11 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Well log4j.properties file needs to be in the classpath of the application....Even if i dont put it in the src folder doesnt matter really as log4j will find it under the WEB-INF/classes directory an initialize itself. My problem has been solved now. I was using Orion as my app server and it was having a log4j.jar file under its /lib directory. Again i was having yet another log4j.jar inside my application's WEB-INF/lib directory. So the same classes were getting loaded by two different Classloader's..one the system classloader and the other one the application class loader. because of the conflict of classloader's the problem was happening.....

subhrajyotia at 2007-7-13 23:31:11 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
r u using Tomcat?..if then placing the log4j.properties in TOMCATHOME/shared/classes/log4j.prop might help u ..
Dattama at 2007-7-13 23:31:11 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...