Below is my log4j.properties file content, file is placed with the src folder in eclipse.
#Application Logs
log4j.rootlogger=INFO, logg
log4j.appender.logg=org.apache.log4j.RollingFileAppender
log4j.appender.logg.File=D:\\SandhyaFiles\\SeleniumWorkspace\\InterviewProject\\Logs\\Testlogs.log
log4j.appender.logg.layout=org.apache.log4j.PatternLayout
log4j.appender.logg.layout.ConversionPattern=%d -%c -%p - %m%n
log4j.appender.logg.maxFileSize=5MB
log4j.appender.logg.maxBackupIndex=3
Inside Library package i have initialised and used logj as below:
public class Library
{
public static final Logger Log = Logger.getLogger(Library.class);
public void initialized(){
Log.info("Inside initialise")
}}
calling initialize from testcase throws log4j warning:
log4j:WARN No appenders could be found for logger (library.Library). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Please Help me fix this.