dcsimg
Anyway to truncate log file?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Tim_Moore
Posted On:   Wednesday, March 3, 2004 04:35 PM


I have a task that kicks off and runs, I want to copy the contents of the log4j log file that was created and truncate it so it is empty for the next time the task runs.

Any thoughts?

Re: Anyway to truncate log file?

Posted By:   Tim_Moore  
Posted On:   Thursday, March 4, 2004 05:34 AM

Just in case anyone needs to know ...

Using a FileAppender and doing the following in your code seems to work.


FileAppender appender = (FileAppender)log.getAppender("myLogFile");

appender.activateOptions();
About | Sitemap | Contact