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: 54b5a1a1c52408ae30472d1b5f25a157603fd626
> <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 -->
This commit is contained in:
Wyatt Walter 2025-10-03 11:08:14 -05:00 committed by GitHub
parent 47cd68742e
commit 336d318222
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 8 deletions

View File

@ -10,7 +10,7 @@ username=%(ENV_APPSMITH_SUPERVISOR_USER)s
password=%(ENV_APPSMITH_SUPERVISOR_PASSWORD)s password=%(ENV_APPSMITH_SUPERVISOR_PASSWORD)s
[supervisord] [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) pidfile=%(ENV_TMP)s/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=%(ENV_APPSMITH_LOG_DIR)s/supervisor ; ('AUTO' child log dir, default $TEMP) childlogdir=%(ENV_APPSMITH_LOG_DIR)s/supervisor ; ('AUTO' child log dir, default $TEMP)
stdout_logfile_maxbytes = 0 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 files = %(ENV_SUPERVISORD_CONF_TARGET)s/*.conf
[eventlistener:stdout] [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 command = python3 -m supervisor.appsmith_supervisor_stdout
buffer_size = 10000 buffer_size = 10000
events = PROCESS_LOG events = PROCESS_LOG
result_handler = supervisor.appsmith_supervisor_stdout:event_handler result_handler = supervisor.appsmith_supervisor_stdout:event_handler
stdout_logfile=%(ENV_APPSMITH_LOG_DIR)s/supervisor/access-supervisor-%(ENV_HOSTNAME)s.log stdout_logfile=/dev/null
stderr_logfile=%(ENV_APPSMITH_LOG_DIR)s/supervisor/error-supervisor-%(ENV_HOSTNAME)s.log stderr_logfile=/dev/null
stdout_logfile_maxbytes=10MB
stderr_logfile_maxbytes=10MB
stdout_logfile_backups=10
stderr_logfile_backups=10

View File

@ -42,7 +42,6 @@ const parts = []
parts.push(` parts.push(`
{ {
debug
admin 0.0.0.0:2019 admin 0.0.0.0:2019
persist_config off persist_config off
acme_ca_root /etc/ssl/certs/ca-certificates.crt acme_ca_root /etc/ssl/certs/ca-certificates.crt