I use Log4J to log application runtime process. Here is my log4j.properties file:
log4j.rootLogger=INFO, DailyRollingFile
log4j.appender.DailyRollingFile=org.apache.log4j.DailyRollingFileAppender
log4j.appender.DailyRollingFile.File=${CATALINA_HOME}/logs/fnservice.log
log4j.appender.DailyRollingFile.append = true
log4j.appender.DailyRollingFile.DatePattern='.'yyyy-MM-dd
log4j.appender.DailyRollingFile.layout=org.apache.log4j.PatternLayout
log4j.appender.DailyRollingFile.layout.ConversionPattern=%d{HH:mm:ss} %-5p %t %c{1} %M:%L - %m%n'
I have deployed application on Tomcat and invoked some it's methods to get log messages. After these manipulations, into ${CATALINA_HOME}/logs folder I got a few .log files:
- catalina.2017-02-12.log; (no my app messages)
- catalina.out; (no my app messages)
- host-manager.2017-02-12.log; (emply)
- localhost.2017-02-12.log; (no my app messages)
- localhost_access_log.2017-02-11.txt; (no my app messages)
- manager.2017-02-11.log. (empty)
In my application I get loggers as:
//the code inside the MyClass class
Logger LOG = Logger.getLogger(MyClass.class);
Also I try to log messages with INFO and ERROR level.
As a result I get listed files and no one contains my log messages. And it seems that rolling does not work too.