From ca2d32ad44d28658dc7c994e06336f417788d2e8 Mon Sep 17 00:00:00 2001 From: Chiradeep Vittal Date: Wed, 12 Jan 2011 11:14:12 -0800 Subject: [PATCH] initial debian config for logging --- .../systemvm/debian/config/etc/logrotate.conf | 32 +++++ .../debian/config/etc/logrotate.d/apache2 | 13 ++ .../debian/config/etc/logrotate.d/ppp | 9 ++ .../debian/config/etc/logrotate.d/rsyslog | 37 ++++++ .../systemvm/debian/config/etc/rsyslog.conf | 116 ++++++++++++++++++ 5 files changed, 207 insertions(+) create mode 100644 patches/systemvm/debian/config/etc/logrotate.conf create mode 100644 patches/systemvm/debian/config/etc/logrotate.d/apache2 create mode 100644 patches/systemvm/debian/config/etc/logrotate.d/ppp create mode 100644 patches/systemvm/debian/config/etc/logrotate.d/rsyslog create mode 100644 patches/systemvm/debian/config/etc/rsyslog.conf diff --git a/patches/systemvm/debian/config/etc/logrotate.conf b/patches/systemvm/debian/config/etc/logrotate.conf new file mode 100644 index 00000000000..4bd60ab4e4e --- /dev/null +++ b/patches/systemvm/debian/config/etc/logrotate.conf @@ -0,0 +1,32 @@ +# 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 0660 root utmp + rotate 1 +} + +# system-specific logs may be configured here diff --git a/patches/systemvm/debian/config/etc/logrotate.d/apache2 b/patches/systemvm/debian/config/etc/logrotate.d/apache2 new file mode 100644 index 00000000000..f2dd950bf26 --- /dev/null +++ b/patches/systemvm/debian/config/etc/logrotate.d/apache2 @@ -0,0 +1,13 @@ +/var/log/apache2/*.log { + weekly + missingok + rotate 52 + compress + delaycompress + notifempty + create 640 root adm + sharedscripts + postrotate + /etc/init.d/apache2 reload > /dev/null + endscript +} diff --git a/patches/systemvm/debian/config/etc/logrotate.d/ppp b/patches/systemvm/debian/config/etc/logrotate.d/ppp new file mode 100644 index 00000000000..35054639a4d --- /dev/null +++ b/patches/systemvm/debian/config/etc/logrotate.d/ppp @@ -0,0 +1,9 @@ +/var/log/ppp-connect-errors { + weekly + rotate 4 + missingok + notifempty + compress + nocreate +} + diff --git a/patches/systemvm/debian/config/etc/logrotate.d/rsyslog b/patches/systemvm/debian/config/etc/logrotate.d/rsyslog new file mode 100644 index 00000000000..9ce5a447a43 --- /dev/null +++ b/patches/systemvm/debian/config/etc/logrotate.d/rsyslog @@ -0,0 +1,37 @@ +/var/log/syslog +{ + rotate 7 + daily + missingok + notifempty + delaycompress + compress + postrotate + invoke-rc.d rsyslog reload > /dev/null + endscript +} + +/var/log/mail.info +/var/log/mail.warn +/var/log/mail.err +/var/log/mail.log +/var/log/daemon.log +/var/log/kern.log +/var/log/auth.log +/var/log/user.log +/var/log/lpr.log +/var/log/cron.log +/var/log/debug +/var/log/messages +{ + rotate 4 + weekly + missingok + notifempty + compress + delaycompress + sharedscripts + postrotate + invoke-rc.d rsyslog reload > /dev/null + endscript +} diff --git a/patches/systemvm/debian/config/etc/rsyslog.conf b/patches/systemvm/debian/config/etc/rsyslog.conf new file mode 100644 index 00000000000..2a7f9f9867d --- /dev/null +++ b/patches/systemvm/debian/config/etc/rsyslog.conf @@ -0,0 +1,116 @@ +# /etc/rsyslog.conf Configuration file for rsyslog. +# +# For more information see +# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html + + +################# +#### MODULES #### +################# + +$ModLoad imuxsock # provides support for local system logging +$ModLoad imklog # provides kernel logging support (previously done by rklogd) +#$ModLoad immark # provides --MARK-- message capability + +# provides UDP syslog reception +#$ModLoad imudp +#$UDPServerRun 514 + +# provides TCP syslog reception +#$ModLoad imtcp +#$InputTCPServerRun 514 + + +########################### +#### GLOBAL DIRECTIVES #### +########################### + +# +# Use traditional timestamp format. +# To enable high precision timestamps, comment out the following line. +# +$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat + +# +# Set the default permissions for all log files. +# +$FileOwner root +$FileGroup adm +$FileCreateMode 0640 +$DirCreateMode 0755 +$Umask 0022 + +# +# Include all config files in /etc/rsyslog.d/ +# +$IncludeConfig /etc/rsyslog.d/*.conf + + +############### +#### RULES #### +############### + +# +# First some standard log files. Log by facility. +# +auth,authpriv.* /var/log/auth.log +*.*;auth,authpriv.none -/var/log/syslog +#cron.* /var/log/cron.log +daemon.* -/var/log/daemon.log +kern.* -/var/log/kern.log +lpr.* -/var/log/lpr.log +mail.* -/var/log/mail.log +user.* -/var/log/user.log + +# +# Logging for the mail system. Split it up so that +# it is easy to write scripts to parse these files. +# +mail.info -/var/log/mail.info +mail.warn -/var/log/mail.warn +mail.err /var/log/mail.err + +# +# Logging for INN news system. +# +news.crit /var/log/news/news.crit +news.err /var/log/news/news.err +news.notice -/var/log/news/news.notice + +# +# Some "catch-all" log files. +# +*.=debug;\ + auth,authpriv.none;\ + news.none;mail.none -/var/log/debug +*.=info;*.=notice;*.=warn;\ + auth,authpriv.none;\ + cron,daemon.none;\ + mail,news.none -/var/log/messages + +# +# Emergencies are sent to everybody logged in. +# +*.emerg * + +# +# I like to have messages displayed on the console, but only on a virtual +# console I usually leave idle. +# +#daemon,mail.*;\ +# news.=crit;news.=err;news.=notice;\ +# *.=debug;*.=info;\ +# *.=notice;*.=warn /dev/tty8 + +# The named pipe /dev/xconsole is for the `xconsole' utility. To use it, +# you must invoke `xconsole' with the `-file' option: +# +# $ xconsole -file /dev/xconsole [...] +# +# NOTE: adjust the list below, or you'll go crazy if you have a reasonably +# busy site.. +# +daemon.*;mail.*;\ + news.err;\ + *.=debug;*.=info;\ + *.=notice;*.=warn |/dev/xconsole