I have been using logrotation for years and never thought too much of it being a problem until I came across a question on stackoverflow (https://stackoverflow.com/questions/1508734/disable-java-log-rotation/) where someone wants to disable log rotation.
To me with experience in having build server and even production servers cleaned up manually because logs are not rotated and discs are running out and suddenly machines come to a halt that all seems crazy, but it occurred to me that maybe it is not so obvious after all.
So what are the benefits of log rotation? And what are the drawbacks (e.g. more difficult to debug/analyze maybe)? What tools do you find useful for working with rotated log files? Splunk I assume, but what else?
I think the benefits of log rotation are clear:
size
option)compress
option).daily
,monthly
, etc).rotate 30
).dateext
).prerotate
,postrotate
).EDIT: I added more items to the list and included the options when applicable. For more details,
man logrotate
can be consulted.Benefits:
Drawbacks:
If you think about what you use logs for, the benefits become even more clear. Leaving aside the obvious points mentioned by others and yourself. For me the big benefit is that I can control how the logs are fed into offline analysis tools.
I've got an assortment of home-grown scripts I use for analysing logs - but, AFAIK, splunk and the various webloog analysis tools are the only 'standard' tools available off the shelf. (not counting realtime log file analyzers like fail2ban).