1

What does rotated log file means? There is any example?

I used to see this term in logging libraries documentation but couldn't understand the meaning.

Update: there is any different from a rolling log file?

5

Rotating means that log files (which tend to grow indefinitely) are automatically copied to a different name and a new file started under the old name. (Usually, old log files are also deleted after some time, since otherwise you wouldn't save any space.)

This means that the file with the normal name is always the most current one, "logfile.1" is the second youngest, etc. This is similar to a group of people taking turns at fulfilling a fixed set of roles, hence "rotating".

  • Thank you very much for the answer. Another term that I'm still trying to understand is rolling log file, can you explain me what does it means? – Yair Nevet Aug 24 '18 at 7:17
  • 1
    @YairNevet Rolling a log file either means the same as rotating, or (more rarely) that when the file gets too large, you simply cut off part of the beginning. That effect resembles text scrolling across a teleprompter. – Kilian Foth Aug 24 '18 at 7:54
  • I'm referring to the following documentation: "tailable: If true, log files will be rolled based on maxsize and maxfiles, but in ascending order. The filename will always have the most recent log lines. The larger the appended number, the older the log file. This option requires maxFiles to be set, or it will be ignored." what "log files will be rolled" means in this context? – Yair Nevet Aug 24 '18 at 12:42
1

log rotation means that when your log file reaches the size limit or the time-limit (e.g. one day) then it "rotates": meaning, the current log file is saved aside with a different name (configurable), and a new log file is created.

hope that helps :-)

  • Thanks for the answer, can you also explain me what a rolling log file means? – Yair Nevet Aug 20 '18 at 13:43
  • AFAIK it is the same thing – OhadR Aug 20 '18 at 13:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.