Showing results for 
Search instead for 
Did you mean: 

Using JavaCil LogWrapper over a year boundary

This blog was generated from CDN blog

Created by: David Lender on 16-02-2009 04:08:06 PM
Be careful when using the JavaCil LogWrapper.  Users found that when the year changed from 2008 to 2009 the deleting of old files specified by the number of files to maintain didn't work correctly.

When using the JavaCil LogWrapper class, the format is

LogWrapper(java.lang.String sFileName, long iMaxSize, int iArchives, int iExpires, int iFlushIntervalMs)

(note that in the dev guide page 12-37-38 that the iExpires parameter is listed in the description but not in the syntax.)

This creates a new LogWrapper object that traces to the file specified in sFileName and sets all the tracing properties provided: the maximum size of a single trace file (the default is 2048 Kb); the maximum number of trace files (iArchives) before LoggerManager will start deleting the oldest file (the default is 4).  iExpires is used to determine how many days before the trace file expires.  Flushintervalms is used to flush the buffer when writing to the log and does not affect retention.

A customer reported a problem with this LogWrapper class over the year boundary such that on 1/1/2009 files older than n days in 12/x/2008 were not overwritten.

I modified the sample in C:\Program Files\Cisco Systems\CTIOS Client\CTIOS Toolkit\Java CIL\samples\AllAgents to use the following:

      lwLogFile = new LogWrapper("./Log/AllAgents.log", 1000, 3, 3, 2000);

Instead of:

lwLogFile = new LogWrapper("./Log/AllAgents.log");

I noted that on 12/28/2008 through 12/31/2008, the LogWrapper deleted the oldest file and created a new one each day.
On 1/1/2009 the oldest file (12/29/2008) did not get deleted.
On 1/2/2009 the file from 1/1/2009 got deleted but the others from
did not.

So it appears the customer is that correct that the logwrapper does not work over the year boundary.  There is now a DDTS against the JavaCIl, specifically the LogWrapper which is DDTS CSCsx41424.  This bug is  scheduled to be fixed in CTIOS Version 7.5(5) due out in May 2009 and in Version 8.0 which is currently scheduled for release early in 2010.
This widget could not be displayed.