>Why would it be wrong to just keep appending to `current' instead of
>moving it to `.u' file? (see my patch at end of bug thread)
On a crash, it is possible that a file you're writing to gets
corrupted. For the integrity of your logs, it's better to move that
potentially corrupted file to another place and start over.
If loggers kept appending to "current" instead, it could have
corrupt information in the middle of a "current" file, which would
them be archived as a .s (intact file), which wouldn't be good.
Please don't change that behaviour - it's correct.
Loggers should not be repeatedly crashing and wiping out your
existing logs by excessive rotations. If you have a repeatedly crashing
logger, something is wrong in your installation (or the way you built
the logger). However, if you cannot trust your installation, a
workaround is to use s6-log, which is very similar to svlogd and
understands a "S" directive, meaning "total size of archived files in
the directory". Using a large "n" value (maximum number of archived
files) and an appropriate "S" value will keep all your logs even in
the case of repeated crashes - which will not happen with s6-log.
--
Laurent
Received on Thu Dec 27 2018 - 11:41:13 UTC