10.1. Logging policies

Logging policies vary from site to site. Common schemes include the following:

  • Throw away all data immediately.

  • Reset log files at periodic intervals.

  • Rotate log files, keeping data for a fixed time.

  • Compress and archive logs to tape or other permanent media.

The correct choice for your site depends on how much disk space you have and how security conscious you are. Even sites with an abundance of disk space must deal with the cancerous growth of log files.

Whatever scheme you select, you should automate the maintenance of log files with cron. See Chapter 8, Periodic Processes, for more information about cron.

Throwing away log files

We do not recommend throwing away all logging information. Sites that ...

Get Linux Administration Handbook, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.