| Author |
How to use log4j to log a file whose file name is daily based?
|
Hai Lin
Ranch Hand
Joined: May 23, 2004
Posts: 79
|
|
Hi All, I'm using log4j to do log for the java application, and the logged file name should be automatically changed every day, for example, today's log file should be 12152004test1.log (today is Dec/15), and tomorrow's log will automatically become 12162004test1.log when I start up the application. Could anyone tell me how to set the property about: log4j.rootCategory=DEBUG, MYLOG log4j.appender.MYLOG.File=C:\\tomcat\\webapps\\test\\... Thanks a lot. Hai
|
 |
David O'Meara
Rancher
Joined: Mar 06, 2001
Posts: 13459
|
|
This is not a Servlet question, moving to Other Open Source Projects [ December 16, 2004: Message edited by: David O'Meara ]
|
[ JavaRanch FAQ ][ Book Promotions ][ DbTamer ][ BumperStickers ][ JavaRanch Badges ]
|
 |
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11945
|
|
|
Take a look at the javadocs of org.apache.log4j.DailyRollingFileAppender.
|
Author of Test Driven (Manning Publications, 2007) [Blog] [HowToAskQuestionsOnJavaRanch]
|
 |
 |
|
|
subject: How to use log4j to log a file whose file name is daily based?
|
|
|