Issue with log4j properties file | Selenium Forum
M
Posted on 05/05/2016
I created the log4j propertiesfile. Added

the following lines in the properties file:

#Application Logs

log4j.logger.devpinoyLogger=DEBUG, FILE
log4j.Appender.FILE=org.apache.log4j.RollingFileAppender
log4j.Appender.FILE.maxFileSize=5000KB
log4j.Appender.FILE.maxBackupIndex=3
log4j.Appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.Appender.FILE.layout.ConversionPattern=%d(MM/dd/yyyy HH:mm:ss) %c %m%n
log4j.Appender.FILE.File=C:\\ecwSetup\\testing\\Application.log
log4j.Appender.FILE.Append=False


The class file is initializing devpinoyLogger:

import org.apache.log4j.Logger;

public class Test_log4j {

public static void main(String[] args) {
// TODO Auto-generated method stub

Logger Application_logs =Logger.getLogger("devpinoyLogger");
Application_logs.debug("Starting");
Application_logs.debug("Executing");
Application_logs.debug("Ending");

}

}


But on executing this code, I get an error:

log4j:WARN No appenders could be found for logger (devpinoyLogger).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

I do not have the dom4j jar imported in my project. I did not see it in the binary poi distribution. Is that why?

M
Replied on 06/05/2016

I downloaded it from here:
https://poi.apache.org/download.html

And it is missing the dom4j jar.


M
Replied on 06/05/2016

http://www.java2s.com/Code/Jar/d/Downloaddom4jjar.htm