At 16:02 05.12.2002 +0000, Thomas Muller wrote:
That's a good question and obviously a very valid requirement. The problem
is that the rollover mechanism is conducted in the same thread is the actual
logging (unless some sort of async logging is enforced), hence to force
logging at a certain moment in time you must issue a log statement at that
time. I believe that the clever log4j programmers will come up with extended
and more flexible rollover mechanisms in future versions (I think this is
planned for the next version, anyone?).
Correct. In log4j 1.3 one will be able to easily change the rollover policy
or independently the copying policy.
In the meantime, issuing a dummy log call at midnight is not all that bad.
Use a Timer that kicks off a task that does this job in a generic manner.
One very important point to remember is that for day 'n', the rolled over
file will correctly contain the output for day 'n' only, even if the
rollover occurred after midnight at day 'n+1'.
--
Thomas
--
Ceki
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>