Have created log4j.properties file in my project as below, but the log file(test-service.log) is not getting created instead the log messages are getting logged in catalina.out how to resolve this.......
log4j.debug=TRUE log4j.rootLogger=WARN, R log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=/opt/apache-tomcat-7.0.40/logs/test-service.log log4j.appender.R.MaxFileSize=1000KB log4j.appender.R.MaxBackupIndex=5 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSSS}-%t-%x-%-5p-%-10c:%m%n
Initialize a logger in your classes like:
private static final Logger LOG = Logger.getLogger(ClassName.class);