Logged In: YES
user_id=308438
I don't feel that the current behaviour is inconsistent,
because you normally want the current log file to be
appended to, when the program starts. (Of course, you can
override this to specify "w" and start with a new file for
every run.) However, when you rollover, you want the new
file to be truncated, and not have new log messages appended
to existing data. Hence, "a" is used at first, and "w" at
rollover. Remember, the log file before rollover (e.g.
test.log) is renamed to test.log.n, and rolled-over output
goes into test.log. Since the original test.log is now
test.log.n, what does it mean to open test.log with "a"?
Since test.log does not exist, opening with "w" and "a" are
equivalent.
If you spot a flaw in this reasoning, please re-open and
give a more detailed scenario which explains exactly why the
current behaviour is causing you a problem. In particular,
it would help if you could walk me through a scenario which
shows how the system would behave observably differently if
"a" were used instead of "w" at rollover.
|