logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aggarwal, Rajat" <rajat.aggar...@razorsight.com>
Subject Using HTMLLayout with DailyRollingFileAppender
Date Fri, 04 Jul 2008 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


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message