add logger function, send log to /proc/1/fd/1

This commit is contained in:
Gerrit Gogel 2021-02-02 00:32:06 +01:00
parent 2c3437df5d
commit 4a12869de9
2 changed files with 7 additions and 1 deletions

View file

@ -83,11 +83,12 @@ ENV CCNET_CONF_DIR=/opt/seafile/conf/ccnet
ENV SEAFILE_CONF_DIR=/opt/seafile/seafile-data
ENV SEAFILE_CENTRAL_CONF_DIR=/opt/seafile/conf
ENV SEAFILE_RPC_PIPE_PATH=/opt/seafile/seafile-server-latest/runtime
ENV SEAHUB_LOG_DIR=/opt/seafile/logs
ENV SEAFILE_ADMIN_EMAIL=me@example.com
ENV SEAFILE_ADMIN_PASSWORD=asecret
RUN mkdir -p /opt/seafile/logs &&\
ln -sf /dev/stdout /opt/seafile/logs/seahub.log
touch /opt/seafile/logs/seahub.log
EXPOSE 8000

View file

@ -36,6 +36,10 @@ function watch_server {
done
}
function logger {
tail -f /opt/seafile/logs/seahub.log | tee /proc/1/fd/1
}
function keep_running {
while true; do
tail -f /dev/null & wait ${!}
@ -46,4 +50,5 @@ start_socat &
init_seahub
start_seahub &
watch_server &
logger
keep_running