Another tiny defect (I am making this a habit) - on the line that says :
youngest = rotations[ i ] + 1;
remove the "+ 1" as we already have the oldest file - no point taking the
next file as this is not necessary older. It should read:
youngest = rotations[ i ];
David Gray
18/04/2002 14:16
To: [EMAIL PROTECTED]
cc:
Subject: Re: Logkit: RevolvingFileStrategy - suggested changes.
Oops - upon further use of the component I found 1 little defect - when the
maximum number of rotations are reached the code is selecting the oldest
file to overwrite (in my case #10) rather than the earliest. Sorry I did
not test sooner but I did see something strange earlier - just did not
follow it up.
Only a one line change required to fix - in
org.apache.log.output.io.rotate.RevolvingFileStrategy.calculateInitialRotation
) change the line that reads
if( lastModified > time )
to read
if( lastModified < time )
as we only want the files which were created earlier than the current
initial rotation.
David Gray
02/04/2002 11:29
To: "Avalon Developers List" <[EMAIL PROTECTED]>
cc:
Subject: Re: Logkit: RevolvingFileStrategy - suggested changes.
(Document link: David Gray)
Have tested this at it looks to be working - also had a look at your code
changes - bit more modular than my original. And my name up in lights also.
The only thing I can suggest is to remove the System.out in the
calculateInitialRotation method (Presumably there for testing)
Peter Donald <[EMAIL PROTECTED]> on 30/03/2002 01:48:14
Okays. I applied your changes but I rearranged them to make them a little
easier to understand. I also wrote some unit tests to make sure everything
was behaving as expected (and it was). Anyways could you have a look at
changes and see if they work for you ?
****************************************************************
NOTICE - This message is intended only for the use of the
addressee named above and may contain privileged and
confidential information. If you are not the intended recipient
of this message you are hereby notified that you must not
disseminate, copy or take any action based upon it. If you
received this message in error please notify HIC immediately.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of HIC.
****************************************************************
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>