Log to redis and file
parent
5e537825e8
commit
980acb507e
|
@ -14,6 +14,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||
supervisor \
|
||||
syslog-ng \
|
||||
syslog-ng-core \
|
||||
syslog-ng-mod-redis \
|
||||
wget \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
|
||||
|
@ -36,12 +37,14 @@ RUN apt-key adv --keyserver keys.gnupg.net --recv-key 0x810273C4 \
|
|||
sogo-activesync \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN sed -i -E 's/^(\s*)system\(\);/\1unix-stream("\/dev\/log");/' /etc/syslog-ng/syslog-ng.conf
|
||||
RUN echo '* * * * * sogo /usr/sbin/sogo-ealarms-notify' > /etc/cron.d/sogo
|
||||
RUN echo '* * * * * sogo /usr/sbin/sogo-ealarms-notify 2>/dev/null' > /etc/cron.d/sogo
|
||||
RUN echo '* * * * * sogo /usr/sbin/sogo-tool expire-sessions 60' >> /etc/cron.d/sogo
|
||||
RUN echo '0 0 * * * sogo /usr/sbin/sogo-tool update-autoreply -p /etc/sogo/sieve.creds' >> /etc/cron.d/sogo
|
||||
|
||||
RUN touch /etc/default/locale
|
||||
|
||||
COPY ./reconf-domains.sh /
|
||||
COPY syslog-ng.conf /etc/syslog-ng/syslog-ng.conf
|
||||
COPY supervisord.conf /etc/supervisor/supervisord.conf
|
||||
|
||||
CMD exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
|
||||
|
|
|
@ -19,7 +19,7 @@ autorestart=true
|
|||
priority=10
|
||||
|
||||
[program:sogo-syslog]
|
||||
command=/usr/bin/tail -f /var/log/syslog -f /var/log/sogo/sogo.log
|
||||
command=/usr/bin/tail -f /var/log/combined.log
|
||||
stdout_logfile=/dev/fd/1
|
||||
stdout_logfile_maxbytes=0
|
||||
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
@version: 3.5
|
||||
@include "scl.conf"
|
||||
options {
|
||||
chain_hostnames(off);
|
||||
flush_lines(0);
|
||||
use_dns(no);
|
||||
use_fqdn(no);
|
||||
owner("root"); group("adm"); perm(0640);
|
||||
stats_freq(0);
|
||||
bad_hostname("^gconfd$");
|
||||
};
|
||||
source s_src {
|
||||
unix-stream("/dev/log");
|
||||
internal();
|
||||
};
|
||||
source s_sogo {
|
||||
file("/var/log/sogo/sogo.log");
|
||||
};
|
||||
destination d_combined {
|
||||
file("/var/log/combined.log");
|
||||
};
|
||||
destination d_redis {
|
||||
redis(
|
||||
host("redis-mailcow")
|
||||
port(6379)
|
||||
command("LPUSH" "SOGO_LOG" "$(format-json time=\"$S_UNIXTIME\" priority=\"$PRIORITY\" program=\"$PROGRAM\" message=\"$MESSAGE\")\n")
|
||||
);
|
||||
};
|
||||
log {
|
||||
source(s_sogo);
|
||||
source(s_src);
|
||||
destination(d_combined);
|
||||
};
|
||||
log {
|
||||
source(s_sogo);
|
||||
destination(d_redis);
|
||||
};
|
Loading…
Reference in New Issue