log-warper
log-warper copied to clipboard
Log roller should use higher number for newer logs
This way, we don't have to rename every existing log file.
@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 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.