Skip to content

Commit

Permalink
send logs to stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
jtrouth committed Dec 20, 2023
1 parent 0617c1c commit 679a536
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ RUN apt-get update && apt-get -qq install \
redis-tools \
&& rm -rf /var/lib/apt/lists/*

RUN pip install supervisor --break-system-packages
RUN pip install supervisor supervisor-stdout --break-system-packages
COPY supervisord.conf /etc/supervisord.conf

RUN pecl install \
Expand Down
15 changes: 12 additions & 3 deletions supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ user=www-data
group=www-data
; Direct logs to stdout
redirect_stderr=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stdout_events_enabled=true
stderr_events_enabled=true

[program:craft-queue-worker]
; Use the process number in its name (required when using `numprocs`):
Expand All @@ -190,4 +190,13 @@ numprocs=4
command=php craft queue/listen --verbose=1 --color=0
; User + Group should agree with HTTP processes:
user=www-data
group=www-data
group=www-data
redirect_stderr=true
stdout_events_enabled=true
stderr_events_enabled=true

[eventlistener:stdout]
command = supervisor_stdout
buffer_size = 100
events = PROCESS_LOG
result_handler = supervisor_stdout:event_handler

0 comments on commit 679a536

Please sign in to comment.