Rotating log files with logrotate
Log files are important because they provide better insight into what is happening on a system. The debugging and error messages in a log can be used to track down the source of a problem and resolve it quickly. Authentication messages maintain a record of who accessed the system and when, and repeated authentication failures can be a sign that an attacker is trying to gain unauthorized access. However, the usefulness of logs typically diminishes with age, and chatty applications that generate a lot of log entries could, if left unchecked, easily consume all of the system's storage resources. This recipe will show you how to rotate the log files to prevent the files from growing out of control and stale logs from ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access