From 336d31822287a0e9d899e4e69365816db6ae552b Mon Sep 17 00:00:00 2001 From: Wyatt Walter Date: Fri, 3 Oct 2025 11:08:14 -0500 Subject: [PATCH] fix: logs cleanup (#41275) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description > [!TIP] > _Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team)._ > > _Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR._ Addresses at least a couple of issues in a number of support tickets about logs volume: - we were double-logging all messages via Supervisor's eventlistener:stdout configuration. Once to the sub-process's logs, and once to another file in the logs/supervisor directory. The purpose of this listener is to send logs to stdout/stderr so they can be picked up by log aggregation services, no need to write again. - we had debug logs enabled for Caddy which was creating quite a bit of log volume in `logs/editor/-stderr.log` - bonus fix: in a multi-container deployment, all containers were trying to write to `logs/supervisor/supervisord.log` making trying to troubleshoot those deployments more difficult. > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.Sanity" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 54b5a1a1c52408ae30472d1b5f25a157603fd626 > Cypress dashboard. > Tags: `@tag.Sanity` > Spec: >
Fri, 03 Oct 2025 13:38:52 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No ## Summary by CodeRabbit * **Chores** * Simplified logging to route process output to standard output with hostname tagging, reducing per-file logs and disk usage. * Improved reliability of log capture with a dedicated stdout event handler. * Reduced log noise by disabling debug logging in the web server configuration. --- deploy/docker/fs/etc/supervisor/supervisord.conf | 13 ++++++------- deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs | 1 - 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/deploy/docker/fs/etc/supervisor/supervisord.conf b/deploy/docker/fs/etc/supervisor/supervisord.conf index 21d4f98d69..eb1bedac47 100644 --- a/deploy/docker/fs/etc/supervisor/supervisord.conf +++ b/deploy/docker/fs/etc/supervisor/supervisord.conf @@ -10,7 +10,7 @@ username=%(ENV_APPSMITH_SUPERVISOR_USER)s password=%(ENV_APPSMITH_SUPERVISOR_PASSWORD)s [supervisord] -logfile=%(ENV_APPSMITH_LOG_DIR)s/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log) +logfile=%(ENV_APPSMITH_LOG_DIR)s/supervisor/%(ENV_HOSTNAME)s-stdout.log ; (main log file;default $CWD/supervisord.log) pidfile=%(ENV_TMP)s/supervisord.pid ; (supervisord pidfile;default supervisord.pid) childlogdir=%(ENV_APPSMITH_LOG_DIR)s/supervisor ; ('AUTO' child log dir, default $TEMP) stdout_logfile_maxbytes = 0 @@ -35,13 +35,12 @@ serverurl=unix://%(ENV_TMP)s/supervisor.sock ; use a unix:// URL for a unix soc files = %(ENV_SUPERVISORD_CONF_TARGET)s/*.conf [eventlistener:stdout] +# This eventlistener sends logs to the python handler in /usr/lib/python3/dist-packages/supervisor/appsmith_supervisor_stdout.py created in this repo +# It sends logs for individual processes to stdout/stderr of the main process, which lets logging pipelines to capture logs from each process. +# Supervisor then wants to send these messages to a logfile by default, so directing them to /dev/null prevents double logging. command = python3 -m supervisor.appsmith_supervisor_stdout buffer_size = 10000 events = PROCESS_LOG result_handler = supervisor.appsmith_supervisor_stdout:event_handler -stdout_logfile=%(ENV_APPSMITH_LOG_DIR)s/supervisor/access-supervisor-%(ENV_HOSTNAME)s.log -stderr_logfile=%(ENV_APPSMITH_LOG_DIR)s/supervisor/error-supervisor-%(ENV_HOSTNAME)s.log -stdout_logfile_maxbytes=10MB -stderr_logfile_maxbytes=10MB -stdout_logfile_backups=10 -stderr_logfile_backups=10 +stdout_logfile=/dev/null +stderr_logfile=/dev/null diff --git a/deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs b/deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs index ee605f92cf..9a298c485c 100644 --- a/deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs +++ b/deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs @@ -42,7 +42,6 @@ const parts = [] parts.push(` { - debug admin 0.0.0.0:2019 persist_config off acme_ca_root /etc/ssl/certs/ca-certificates.crt