Log Rotation
Return to Logging topics
- Snippet from Wikipedia: Log rotation
In information technology, log rotation is an automated process used in system administration in which log files are compressed, moved (archived), renamed or deleted once they are too old or too large. New incoming log data is directed into a new fresh file at the same location.
The main purpose of log rotation is to prevent log data from consuming excessive disk space, while keeping individual files small enough to be opened and analysed. Servers running large applications, such as LAMP stacks, may log every request, producing large volumes of data over time. Log rotation provides a way to limit the total size of retained logs while still allowing analysis of recent events. Although smaller log files are sometimes said to improve write performance, file size does not in practice affect write speed: in most modern filesystem implementations, the kernel tracks the end-of-file position, so appending data is a constant-time operation regardless of file size.
