log-warper icon indicating copy to clipboard operation
log-warper copied to clipboard

Log roller should use higher number for newer logs

Open avieth opened this issue 7 years ago • 2 comments

This way, we don't have to rename every existing log file.

avieth avatar Feb 22 '18 19:02 avieth

@avieth Just to be sure: when log rotation happens currently file node.log is renamed to node.log.0 and new logs are written in file node.log. What you want is to keep file node.log (don't rename it) and write new logs in file node.log.0. Is that right? Personally, I don't mind, this will simplify code.

Another thing: if we implement this feature than maybe it makes sense to always add id at the end of file? So instead of node.log and node.log.0 there will be node.log.0 and node.log.1 or node.0.log and node.1.log.

chshersh avatar Feb 23 '18 11:02 chshersh

@ChShersh Sure, what you describe sounds fine. Another possibility: always write to node.log for the current "hot" log file. When its time to rotate, rename it to node.log.<n> where n is the first number not already taken by previous rotations.

avieth avatar Feb 23 '18 15:02 avieth