From b0a2a2f24afc34fa5aa0a770e986f4f51b8b9fdc Mon Sep 17 00:00:00 2001 From: Randy Bush Date: Sat, 4 Jul 2020 14:26:04 -0700 Subject: [PATCH] from wiki --- pages/LogToEmail.md | 46 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 pages/LogToEmail.md diff --git a/pages/LogToEmail.md b/pages/LogToEmail.md new file mode 100644 index 0000000..403b5b2 --- /dev/null +++ b/pages/LogToEmail.md @@ -0,0 +1,46 @@ +# Configuring Logging to Email + +We assume you have installed syslog-ng, exim, mail-utils, ... + +``` +cat > /etc/logrotate.d/syslog-ng +/var/log/syslog +{ + rotate 7 + daily + missingok + notifempty + delaycompress + compress + mailfirst + mail randy@psg.com + postrotate + invoke-rc.d syslog-ng 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 syslog-ng reload > /dev/null + endscript +} +``` \ No newline at end of file