Sunday, January 4, 2009

Logs

Linux keeps a bunch of logs for various things. It may be good for some, but for a average user like myself, the standard setting for logs may store logs longer than necessary. The standard setting for logrotate is 4 weeks. Personally, it is a bit too much for my taste. Luckily, this can be changed easily by editing the /etc/logrotate.conf file. Below shows the contents of the logrotate.conf file

# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
#compress

# packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp, or btmp — we'll rotate them here
/var/log/wtmp {
missingok
monthly
create 0664 root utmp
rotate 1
}

/var/log/btmp {
missingok
monthly
create 0664 root utmp
rotate 1
}

# system-specific logs may be configured here