Hibernate-Spring logging with Log4j
I have tried Log4j logging with hibernate and here is what I have..
log4j.properties file under web-inf/classes
log4j.appender.rollingFile = org.apache.log4j.DailyRollingFileAppender
log4j.appender.rollingFile.File = C:\\appl\\logs\\app.log
log4j.appender.rollingFile.Append = true
log4j.appender.rollingFile.DatePattern = '.'yyyy-MM-dd
log4j.appender.rollingFile.layout = org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
log4j.rootLogger = INFO, rollingFile
I have p开发者_运维百科laced all the required jars to web-inf/lib folder
slf4j-api-1.6.1.jar
slf4j-lo4j12-1.6.1.jar
log4j-1.2.16.jar
When I start the application, I see that it started writing logs to app.log file. But I want it to write it to a different log file for each day with date attached at the end but it is not doing so.. Can somone point what's wrong in my log4j.properties file and what I should I do to correct it? And also for each new line in .log file I want the date and time to be added.. how to achieve that? thanks!
精彩评论