Config supervisord to write logs into log files (#8145)

This commit is contained in:
geekup-legodevops 2021-10-19 14:29:55 +07:00 committed by GitHub
parent 8f32a6dba3
commit 6cbe4b8faf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 64 additions and 25 deletions

View File

@ -10,10 +10,13 @@ ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8 ENV LC_ALL C.UTF-8
# Update APT packages - Base Layer # Update APT packages - Base Layer
RUN apt-get update && apt-get install --no-install-recommends -y \ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
supervisor curl cron certbot nginx gnupg wget \ supervisor curl cron certbot nginx gnupg wget \
software-properties-common gettext openjdk-11-jre \ software-properties-common gettext openjdk-11-jre \
python3-pip python-setuptools git \
&& add-apt-repository ppa:redislabs/redis \ && add-apt-repository ppa:redislabs/redis \
&& pip install --no-cache-dir git+https://github.com/coderanger/supervisor-stdout@973ba19967cdaf46d9c1634d1675fc65b9574f6e \
&& apt-get remove -y git python3-pip \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*

View File

@ -198,5 +198,8 @@ configure_supervisord
# Ensure the restore path exists in the container, so an archive can be copied to it, if need be. # Ensure the restore path exists in the container, so an archive can be copied to it, if need be.
mkdir -p /appsmith-stacks/data/{backup,restore} mkdir -p /appsmith-stacks/data/{backup,restore}
# Create sub-directory to store services log in the container mounting folder
mkdir -p /appsmith-stacks/logs/{backend,cron,editor,rts,mongodb,redis}
# Handle CMD command # Handle CMD command
exec "$@" exec "$@"

View File

@ -33,3 +33,12 @@ serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket
[include] [include]
files = /etc/supervisor/conf.d/*.conf files = /etc/supervisor/conf.d/*.conf
; This event listener is used to capture processes log
; and forward to container log using supervisor_stdout
; Ref: https://github.com/coderanger/supervisor-stdout
[eventlistener:stdout]
command = supervisor_stdout
buffer_size = 100
events = PROCESS_LOG
result_handler = supervisor_stdout:event_handler

View File

@ -6,7 +6,11 @@ autostart=true
autorestart=true autorestart=true
startsecs=10 startsecs=10
startretries=3 startretries=3
stdout_logfile_maxbytes = 0 stdout_logfile=/appsmith-stacks/logs/%(program_name)s/%(program_name)s.log
stderr_logfile_maxbytes = 0 redirect_stderr=true
stdout_logfile=/dev/stdout stdout_logfile_maxbytes=10MB
stderr_logfile=/dev/stderr stderr_logfile_maxbytes=10MB
stdout_logfile_backups=5
stderr_logfile_backups=5
stdout_events_enabled=true
stderr_events_enabled=true

View File

@ -6,7 +6,11 @@ autostart=true
autorestart=true autorestart=true
startsecs=0 startsecs=0
startretries=3 startretries=3
stdout_logfile=/dev/stdout stdout_logfile=/appsmith-stacks/logs/%(program_name)s/%(program_name)s.log
stderr_logfile=/dev/stderr redirect_stderr=true
stdout_logfile_maxbytes=0 stdout_logfile_maxbytes=10MB
stderr_logfile_maxbytes=0 stderr_logfile_maxbytes=10MB
stdout_logfile_backups=5
stderr_logfile_backups=5
stdout_events_enabled=true
stderr_events_enabled=true

View File

@ -5,8 +5,12 @@ autostart=true
autorestart=true autorestart=true
startsecs=0 startsecs=0
startretries=3 startretries=3
stdout_logfile_maxbytes = 0 stdout_logfile=/appsmith-stacks/logs/%(program_name)s/%(program_name)s.log
stderr_logfile_maxbytes = 0 redirect_stderr=true
stdout_logfile=/dev/stdout stdout_logfile_maxbytes=10MB
stderr_logfile=/dev/stderr stderr_logfile_maxbytes=10MB
stdout_logfile_backups=5
stderr_logfile_backups=5
stdout_events_enabled=true
stderr_events_enabled=true
stopsignal=QUIT stopsignal=QUIT

View File

@ -6,7 +6,11 @@ autostart=true
autorestart=true autorestart=true
startsecs=0 startsecs=0
startretries=3 startretries=3
stdout_logfile_maxbytes = 0 stdout_logfile=/appsmith-stacks/logs/%(program_name)s/%(program_name)s.log
stderr_logfile_maxbytes = 0 redirect_stderr=true
stdout_logfile=/dev/stdout stdout_logfile_maxbytes=10MB
stderr_logfile=/dev/stderr stderr_logfile_maxbytes=10MB
stdout_logfile_backups=5
stderr_logfile_backups=5
stdout_events_enabled=true
stderr_events_enabled=true

View File

@ -6,7 +6,11 @@ autostart=true
autorestart=true autorestart=true
startsecs=10 startsecs=10
startretries=3 startretries=3
stdout_logfile_maxbytes = 0 stdout_logfile=/appsmith-stacks/logs/%(program_name)s/%(program_name)s.log
stderr_logfile_maxbytes = 0 redirect_stderr=true
stdout_logfile=/dev/stdout stdout_logfile_maxbytes=10MB
stderr_logfile=/dev/stderr stderr_logfile_maxbytes=10MB
stdout_logfile_backups=5
stderr_logfile_backups=5
stdout_events_enabled=true
stderr_events_enabled=true

View File

@ -6,7 +6,11 @@ autostart=true
autorestart=true autorestart=true
startsecs=0 startsecs=0
startretries=3 startretries=3
stdout_logfile_maxbytes = 0 stdout_logfile=/appsmith-stacks/logs/%(program_name)s/%(program_name)s.log
stderr_logfile_maxbytes = 0 redirect_stderr=true
stdout_logfile=/dev/stdout stdout_logfile_maxbytes=10MB
stderr_logfile=/dev/stderr stderr_logfile_maxbytes=10MB
stdout_logfile_backups=5
stderr_logfile_backups=5
stdout_events_enabled=true
stderr_events_enabled=true