[Compose] New images with LOG_LINES

[Update] Do not add empty line in each loop
This commit is contained in:
andre.peters
2018-01-08 22:00:54 +01:00
parent 1c2ec43aa0
commit 1e9cae9084
9 changed files with 29 additions and 13 deletions

View File

@@ -12,7 +12,7 @@ log_f() {
fi
redis-cli -h redis LPUSH ACME_LOG "{\"time\":\"$(date +%s)\",\"message\":\"$(printf '%s' "${1}" | \
tr '%&;$"_[]{}-\r\n' ' ')\"}" > /dev/null
redis-cli -h redis LTRIM ACME_LOG 0 9999 > /dev/null
redis-cli -h redis LTRIM ACME_LOG 0 ${LOG_LINES} > /dev/null
}
if [[ "${SKIP_LETS_ENCRYPT}" =~ ^([yY][eE][sS]|[yY])+$ ]]; then

View File

@@ -6,7 +6,7 @@ ENV LC_ALL C
ENV DOVECOT_VERSION 2.2.33.2
ENV PIGEONHOLE_VERSION 0.4.21
RUN apt-get update && apt-get -y install \
RUN apt-get update && apt-get -y --no-install-recommends install \
automake \
autotools-dev \
build-essential \
@@ -56,6 +56,7 @@ RUN apt-get update && apt-get -y install \
make \
procps \
supervisor \
cron \
syslog-ng \
syslog-ng-core \
syslog-ng-mod-redis \

View File

@@ -35,7 +35,7 @@ destination d_redis_cleanup {
host("redis-mailcow")
persist-name("redis3")
port(6379)
command("LTRIM" "DOVECOT_MAILLOG" "0" "9999")
command("LTRIM" "DOVECOT_MAILLOG" "0" "`LOG_LINES`")
);
};
filter f_mail { facility(mail); };

View File

@@ -35,7 +35,7 @@ destination d_redis_cleanup {
host("redis-mailcow")
persist-name("redis3")
port(6379)
command("LTRIM" "POSTFIX_MAILLOG" "0" "9999")
command("LTRIM" "POSTFIX_MAILLOG" "0" "`LOG_LINES`")
);
};
filter f_mail { facility(mail); };

View File

@@ -38,7 +38,7 @@ destination d_redis_cleanup {
host("redis-mailcow")
persist-name("redis3")
port(6379)
command("LTRIM" "SOGO_LOG" "0" "9999")
command("LTRIM" "SOGO_LOG" "0" "`LOG_LINES`")
);
};
log {

View File

@@ -37,7 +37,7 @@ log_msg() {
redis-cli -h redis LPUSH WATCHDOG_LOG "{\"time\":\"$(date +%s)\",\"message\":\"$(printf '%s' "${1}" | \
tr '%&;$"_[]{}-\r\n' ' ')\"}" > /dev/null
fi
redis-cli -h redis LTRIM WATCHDOG_LOG 0 9999 > /dev/null
redis-cli -h redis LTRIM WATCHDOG_LOG 0 ${LOG_LINES} > /dev/null
echo $(date) $(printf '%s\n' "${1}")
}