From 6b1d8cfcdfc999c5dd23f742dd555ca567dfd2bd Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Tue, 14 Feb 2017 14:30:38 +0100 Subject: [PATCH] replace rsyslog with syslog-ng --- Dockerfile | 2 +- rootfs/etc/rsyslog.conf | 48 ----------------------------- rootfs/etc/services.d/rsyslog/run | 3 -- rootfs/etc/services.d/syslog-ng/run | 4 +++ rootfs/etc/syslog-ng/syslog-ng.conf | 24 +++++++++++++++ 5 files changed, 29 insertions(+), 52 deletions(-) delete mode 100644 rootfs/etc/rsyslog.conf delete mode 100644 rootfs/etc/services.d/rsyslog/run create mode 100644 rootfs/etc/services.d/syslog-ng/run create mode 100644 rootfs/etc/syslog-ng/syslog-ng.conf diff --git a/Dockerfile b/Dockerfile index 8d9e479..0d89661 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN apk add --no-cache \ nginx \ postgresql-client \ aspell \ - rsyslog \ + syslog-ng \ ca-certificates \ php7 \ php7-imap \ diff --git a/rootfs/etc/rsyslog.conf b/rootfs/etc/rsyslog.conf deleted file mode 100644 index 6faafe2..0000000 --- a/rootfs/etc/rsyslog.conf +++ /dev/null @@ -1,48 +0,0 @@ -# rsyslogd.conf -# -# if you experience problems, check: -# http://www.rsyslog.com/troubleshoot - -#### MODULES #### - -module(load="imuxsock") # local system logging support (e.g. via logger command) -#module(load="imklog") # kernel logging support (previously done by rklogd) -module(load="immark") # --MARK-- message support -module(load="imudp") # UDP listener support - - -input(type="imudp" port="514") - -# Log all kernel messages to the console. -# Logging much else clutters up the screen. -#kern.* action(type="omfile" file="/dev/console") - -# Log anything (except mail) of level info or higher. -# Don't log private authentication messages! -*.info;mail.none;authpriv.none;cron.none action(type="omfile" file="/var/log/messages") - -# The authpriv file has restricted access. -authpriv.* action(type="omfile" file="/var/log/secure") - -# Log all the mail messages in one place. -mail.* action(type="omfile" file="/dev/console") - -# Log cron stuff -cron.* action(type="omfile" file="/var/log/cron") - -# Everybody gets emergency messages -*.emerg action(type="omusrmsg" users="*") - -# Save news errors of level crit and higher in a special file. -uucp,news.crit action(type="omfile" file="/var/log/spooler") - -# Save boot messages also to boot.log -local7.* action(type="omfile" file="/var/log/boot.log") - -# log every host in its own directory -if $fromhost-ip then /var/log/$fromhost-ip/messages - -# Include all .conf files in /etc/rsyslog.d -$IncludeConfig /etc/rsyslog.d/*.conf -$template GRAYLOGRFC5424,"<%PRI%>%PROTOCOL-VERSION% %TIMESTAMP:::date-rfc3339% %HOSTNAME% %APP-NAME% %PROCID% %MSGID% %STRUCTURED-DATA% %msg%\n" -*.info;mail.none;authpriv.none;cron.none;*.* @@graylog:514;GRAYLOGRFC5424 # forward everything to remote server \ No newline at end of file diff --git a/rootfs/etc/services.d/rsyslog/run b/rootfs/etc/services.d/rsyslog/run deleted file mode 100644 index ae9eac0..0000000 --- a/rootfs/etc/services.d/rsyslog/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/with-contenv sh - -exec rsyslogd -n \ No newline at end of file diff --git a/rootfs/etc/services.d/syslog-ng/run b/rootfs/etc/services.d/syslog-ng/run new file mode 100644 index 0000000..dd9f88a --- /dev/null +++ b/rootfs/etc/services.d/syslog-ng/run @@ -0,0 +1,4 @@ +#!/usr/bin/with-contenv sh + +cd /var +exec syslog-ng --foreground diff --git a/rootfs/etc/syslog-ng/syslog-ng.conf b/rootfs/etc/syslog-ng/syslog-ng.conf new file mode 100644 index 0000000..578aeff --- /dev/null +++ b/rootfs/etc/syslog-ng/syslog-ng.conf @@ -0,0 +1,24 @@ +@version: 3.7 + +options { + stats_freq (0); + time_reopen (10); + chain_hostnames (off); + use_dns (no); + use_fqdn (no); + keep_hostname (yes); +}; + +source s_local { + unix-dgram("/dev/log"); + internal(); +}; + +destination catchall { + pipe("/dev/stdout"); +}; + +log { + source(s_local); + destination(catchall); +};