Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WARN No appenders could be found for logger (org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager)

Tags:

java

log4j

My log4j properties file

log4j.logger.devpinoyLogger=DEBUG, dest1,
log4j.appender.dest1=org.apache.log4j.RollingFileAppender
log4j.appender.dest1.maxFileSize=5000KB
log4j.appender.dest1.maxBackupIndex=3
log4j.appender.dest1.layout=org.apache.log4j.PatternLayout
log4j.appender.dest1.layout.ConversionPattern=%d{dd/MM/yyyy HH:mm:ss} %c %m%n
log4j.appender.dest1.File=C:\\Selenium\\eclipse-jee-juno-SR1-win32\\eclipse\\Workspace\\Core_Hybrid\\src\\com\\logs\\Application.log
log4j.appender.dest1.Append=false

I get the Error msg as stated below :

log4j:WARN No appenders could be found for logger (org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager).
log4j:WARN Please initialize the log4j system properly.

I have placed my properties files inside the src folder and imported the log4j.jar in the build path.

Please help on this

like image 950
Ram Avatar asked Jan 09 '13 12:01

Ram


2 Answers

As I remember the log4j.properties file must be in the root-directory of the execution and added to the classPath. So this means the file must be on the same level as the src-Folder and not within this folder. Or you have to change the root-directory of your execution to your src-folder.

like image 137
Simulant Avatar answered Sep 30 '22 06:09

Simulant


There's a typo in your configuration file. Remove the last ',' in the first line:

     log4j.logger.devpinoyLogger=DEBUG, dest1          

You should define a root logger to avoid such "No appender" warning.

      log4j.rootLogger=DEBUG, dest1
like image 36
Jintian DENG Avatar answered Sep 30 '22 05:09

Jintian DENG