4 Jul 06:54
Using HTMLLayout with DailyRollingFileAppender
From: Aggarwal, Rajat <rajat.aggarwal <at> razorsight.com>
Subject: Using HTMLLayout with DailyRollingFileAppender
Newsgroups: gmane.comp.jakarta.log4j.user
Date: 2008-07-04 04:58:29 GMT
Subject: Using HTMLLayout with DailyRollingFileAppender
Newsgroups: gmane.comp.jakarta.log4j.user
Date: 2008-07-04 04:58:29 GMT
HI All,
I have a requirement in one of my prjects that the log files be
generated in HTML format and that they should automatically be rolled
over everyday. For thi purpose, I am trying to use HTMLLayout with
DailyRollingFileAppender. However, the file is not rolled over. Instead,
the log information is only appended in the old file itself. Is there
any other way in which I can achive the same??
The code I have written for the same is as follows:
Final Logger log = Logger..getLogger(xyz.class);
String strDatePattern = "'.'yyyyMMdd";
HTMLLayout layout = new HTMLLayout();
String filename = "test.html";
DailyRollingFileAppender appender = new DailyRollingFileAppender
(layout, filename, strDatePattern);
appender.activateOptions();
log.info("My Message Goes Here");
Is there anything that I am missing out upon? Or is there some other
way how I can achieve the same?
An early help would be appreciated.
Thanks and Regards
Rajat Aggarwal
RSS Feed