Skip to content

Commit 336d318

Browse files
authored
fix: logs cleanup (#41275)
## 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/<hostname>-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" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/18222964844> > Commit: 54b5a1a > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=18222964844&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Sanity` > Spec: > <hr>Fri, 03 Oct 2025 13:38:52 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## 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. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 47cd687 commit 336d318

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

deploy/docker/fs/etc/supervisor/supervisord.conf

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ username=%(ENV_APPSMITH_SUPERVISOR_USER)s
1010
password=%(ENV_APPSMITH_SUPERVISOR_PASSWORD)s
1111

1212
[supervisord]
13-
logfile=%(ENV_APPSMITH_LOG_DIR)s/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
13+
logfile=%(ENV_APPSMITH_LOG_DIR)s/supervisor/%(ENV_HOSTNAME)s-stdout.log ; (main log file;default $CWD/supervisord.log)
1414
pidfile=%(ENV_TMP)s/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
1515
childlogdir=%(ENV_APPSMITH_LOG_DIR)s/supervisor ; ('AUTO' child log dir, default $TEMP)
1616
stdout_logfile_maxbytes = 0
@@ -35,13 +35,12 @@ serverurl=unix://%(ENV_TMP)s/supervisor.sock ; use a unix:// URL for a unix soc
3535
files = %(ENV_SUPERVISORD_CONF_TARGET)s/*.conf
3636

3737
[eventlistener:stdout]
38+
# This eventlistener sends logs to the python handler in /usr/lib/python3/dist-packages/supervisor/appsmith_supervisor_stdout.py created in this repo
39+
# It sends logs for individual processes to stdout/stderr of the main process, which lets logging pipelines to capture logs from each process.
40+
# Supervisor then wants to send these messages to a logfile by default, so directing them to /dev/null prevents double logging.
3841
command = python3 -m supervisor.appsmith_supervisor_stdout
3942
buffer_size = 10000
4043
events = PROCESS_LOG
4144
result_handler = supervisor.appsmith_supervisor_stdout:event_handler
42-
stdout_logfile=%(ENV_APPSMITH_LOG_DIR)s/supervisor/access-supervisor-%(ENV_HOSTNAME)s.log
43-
stderr_logfile=%(ENV_APPSMITH_LOG_DIR)s/supervisor/error-supervisor-%(ENV_HOSTNAME)s.log
44-
stdout_logfile_maxbytes=10MB
45-
stderr_logfile_maxbytes=10MB
46-
stdout_logfile_backups=10
47-
stderr_logfile_backups=10
45+
stdout_logfile=/dev/null
46+
stderr_logfile=/dev/null

deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ const parts = []
4242

4343
parts.push(`
4444
{
45-
debug
4645
admin 0.0.0.0:2019
4746
persist_config off
4847
acme_ca_root /etc/ssl/certs/ca-certificates.crt

0 commit comments

Comments
 (0)