sidn-lxd-ansible-demo/roles/logging/templates/rsyslog.conf.j2

61 lines
2.2 KiB
Django/Jinja

# {{ ansible_managed }}
# ----------------------------------------------------------------------
# General configuration
# ----------------------------------------------------------------------
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
$RepeatedMsgReduction on
$FileOwner syslog
$FileGroup adm
$FileCreateMode 0640
$DirCreateMode 0755
$Umask 0022
$PrivDropToUser syslog
$PrivDropToGroup syslog
$WorkDirectory /var/spool/rsyslog
# ----------------------------------------------------------------------
# Listening port configuration
# ----------------------------------------------------------------------
# Accept syslog over unix sockets.
$ModLoad imuxsock
# Sockets for chrooted applications.
$AddUnixListenSocket /var/spool/postfix/dev/log
# Accept syslog on localhost over UDP (for chrooted applications that use
# UDP to circumvent possible chroot unix socket access issues).
$ModLoad imudp
$UDPServerAddress 127.0.0.1
$UDPServerRun 514
# ----------------------------------------------------------------------
# Log routing configuration
# ----------------------------------------------------------------------
# Suppress some messages, caused by an issue in the systemd-shim package.
# It's harmless, so let's not log these, to not make these taint our
# error logging counters.
:msg, contains, "pam_systemd(sshd:session): Failed to create session: No such file or directory" stop
:msg, contains, "pam_systemd(su:session): Failed to create session: No such file or directory" stop
# Send cloudinit messages to a dediated logfile.
:syslogtag, isequal, "[CLOUDINIT]" {
/var/log/cloud-init.log
stop
}
# A custom log format for the Voice Platform logging.
$template VoicePlatformLogFmt,"%timegenerated% %HOSTNAME% [%syslogpriority-text%] %syslogtag%%msg:::drop-last-lf%\n"
# Some standard log targets.
auth,authpriv.* /var/log/auth.log
local0.* -/var/log/firewall.log
local1.* -/var/log/voiceplatform.log;VoicePlatformLogFmt
*.*;auth,authpriv,local0,local1.none -/var/log/syslog
kern.* -/var/log/kern.log
mail.* -/var/log/mail.log
*.emerg :omusrmsg:*