feat: Standardize log patterns across all services for consistency. (#38285)

## 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._


Fixes #`Issue Number`  
_or_  
Fixes `Issue URL`
> [!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/12463955629>
> Commit: 1c48cae7a0d980d487a9387aa96e8b5aaaedeadb
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12463955629&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`
> Spec:
> <hr>Mon, 23 Dec 2024 09:18:41 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

- **New Features**
- Enhanced logging capabilities for various services, including distinct
log file paths incorporating hostnames.
	- Introduced event logging for standard output and error streams.

- **Bug Fixes**
	- Improved error handling through updated logging configurations.

- **Chores**
- Reorganized configuration parameters for better clarity and management
across multiple services.
- Increased maximum log file sizes from 10MB to 30MB and set backups to
zero for all services.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Subhrashis Das 2024-12-23 15:15:53 +05:30 committed by GitHub
parent 398f63112a
commit d52490cabb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 58 additions and 59 deletions

View File

@ -1,15 +1,15 @@
[program:backend]
command=/opt/appsmith/run-with-env.sh /opt/appsmith/run-java.sh
priority=20
autostart=true
autorestart=true
startsecs=20
autostart=true
priority=20
startretries=3
stdout_logfile=%(ENV_APPSMITH_LOG_DIR)s/%(program_name)s/%(program_name)s-%(ENV_HOSTNAME)s.log
redirect_stderr=true
stdout_logfile_maxbytes=10MB
stderr_logfile_maxbytes=10MB
stdout_logfile_backups=10
stderr_logfile_backups=10
stdout_events_enabled=true
startsecs=20
stderr_events_enabled=true
stderr_logfile=%(ENV_APPSMITH_LOG_DIR)s/%(program_name)s/%(ENV_HOSTNAME)s-stderr.log
stderr_logfile_backups=0
stderr_logfile_maxbytes=30MB
stdout_events_enabled=true
stdout_logfile=%(ENV_APPSMITH_LOG_DIR)s/%(program_name)s/%(ENV_HOSTNAME)s-stdout.log
stdout_logfile_backups=0
stdout_logfile_maxbytes=30MB

View File

@ -1,16 +1,16 @@
[program:editor]
command=/opt/appsmith/run-with-env.sh /opt/appsmith/run-caddy.sh
priority=25
autostart=true
autorestart=true
startsecs=0
autostart=true
priority=25
startretries=3
stdout_logfile=%(ENV_APPSMITH_LOG_DIR)s/%(program_name)s/access-%(ENV_HOSTNAME)s.log
stderr_logfile=%(ENV_APPSMITH_LOG_DIR)s/%(program_name)s/error-%(ENV_HOSTNAME)s.log
stdout_logfile_maxbytes=10MB
stderr_logfile_maxbytes=10MB
stdout_logfile_backups=2
stderr_logfile_backups=2
stdout_events_enabled=true
startsecs=0
stderr_events_enabled=true
stderr_logfile=%(ENV_APPSMITH_LOG_DIR)s/%(program_name)s/%(ENV_HOSTNAME)s-stderr.log
stderr_logfile_backups=0
stderr_logfile_maxbytes=30MB
stdout_events_enabled=true
stdout_logfile=%(ENV_APPSMITH_LOG_DIR)s/%(program_name)s/%(ENV_HOSTNAME)s-stdout.log
stdout_logfile_backups=0
stdout_logfile_maxbytes=30MB
stopsignal=QUIT

View File

@ -1,16 +1,16 @@
[program:rts]
directory=/opt/appsmith/rts/bundle
command=/opt/appsmith/run-with-env.sh node server.js
priority=15
autostart=true
autorestart=true
startsecs=0
autostart=true
priority=15
startretries=3
stdout_logfile=%(ENV_APPSMITH_LOG_DIR)s/%(program_name)s/%(program_name)s-%(ENV_HOSTNAME)s.log
redirect_stderr=true
stdout_logfile_maxbytes=10MB
stderr_logfile_maxbytes=10MB
stdout_logfile_backups=2
stderr_logfile_backups=2
stdout_events_enabled=true
startsecs=0
stderr_events_enabled=true
stderr_logfile=%(ENV_APPSMITH_LOG_DIR)s/%(program_name)s/%(ENV_HOSTNAME)s-stderr.log
stderr_logfile_backups=0
stderr_logfile_maxbytes=30MB
stdout_events_enabled=true
stdout_logfile=%(ENV_APPSMITH_LOG_DIR)s/%(program_name)s/%(ENV_HOSTNAME)s-stdout.log
stdout_logfile_backups=0
stdout_logfile_maxbytes=30MB

View File

@ -1,16 +1,16 @@
[program:mongodb]
directory=/appsmith-stacks/data/mongodb
command=mongod --port 27017 --dbpath . --logpath %(ENV_APPSMITH_LOG_DIR)s/%(program_name)s/db.log --replSet mr1 --keyFile %(ENV_MONGODB_TMP_KEY_PATH)s --bind_ip localhost
priority=10
autostart=true
autorestart=true
startsecs=10
autostart=true
priority=10
startretries=3
stdout_logfile=%(ENV_APPSMITH_LOG_DIR)s/%(program_name)s/%(program_name)s.log
redirect_stderr=true
stdout_logfile_maxbytes=10MB
stderr_logfile_maxbytes=10MB
stdout_logfile_backups=2
stderr_logfile_backups=2
stdout_events_enabled=true
startsecs=10
stderr_events_enabled=true
stderr_logfile=%(ENV_APPSMITH_LOG_DIR)s/%(program_name)s/%(ENV_HOSTNAME)s-stderr.log
stderr_logfile_backups=0
stderr_logfile_maxbytes=30MB
stdout_events_enabled=true
stdout_logfile=%(ENV_APPSMITH_LOG_DIR)s/%(program_name)s/%(ENV_HOSTNAME)s-stdout.log
stdout_logfile_backups=0
stdout_logfile_maxbytes=30MB

View File

@ -2,15 +2,14 @@
directory=/appsmith-stacks/data/postgres/main
user=postgres
command=/opt/appsmith/run-postgres.sh
autostart=true
autorestart=true
autostart=true
startretries=3
stdout_logfile=%(ENV_APPSMITH_LOG_DIR)s/%(program_name)s/%(program_name)s.log
redirect_stderr=true
stdout_logfile_maxbytes=10MB
stderr_logfile_maxbytes=10MB
stdout_logfile_backups=2
stderr_logfile_backups=2
stdout_events_enabled=true
stderr_events_enabled=true
stderr_logfile=%(ENV_APPSMITH_LOG_DIR)s/%(program_name)s/%(ENV_HOSTNAME)s-stderr.log
stderr_logfile_backups=0
stderr_logfile_maxbytes=30MB
stdout_events_enabled=true
stdout_logfile=%(ENV_APPSMITH_LOG_DIR)s/%(program_name)s/%(ENV_HOSTNAME)s-stdout.log
stdout_logfile_backups=0
stdout_logfile_maxbytes=30MB

View File

@ -3,16 +3,16 @@ directory=/etc/redis
; The `--save` is for saving session data to disk more often, so recent sessions aren't cleared on restart.
; The empty string to `--logfile` is for logging to stdout so that supervisor can capture it.
command=redis-server --save 15 1 --dir /appsmith-stacks/data/redis --daemonize no --logfile ""
priority=5
autostart=true
autorestart=true
startsecs=0
autostart=true
priority=5
startretries=3
stdout_logfile=%(ENV_APPSMITH_LOG_DIR)s/%(program_name)s/%(program_name)s.log
redirect_stderr=true
stdout_logfile_maxbytes=10MB
stderr_logfile_maxbytes=10MB
stdout_logfile_backups=2
stderr_logfile_backups=2
stdout_events_enabled=true
startsecs=0
stderr_events_enabled=true
stderr_logfile=%(ENV_APPSMITH_LOG_DIR)s/%(program_name)s/%(ENV_HOSTNAME)s-stderr.log
stderr_logfile_backups=0
stderr_logfile_maxbytes=30MB
stdout_events_enabled=true
stdout_logfile=%(ENV_APPSMITH_LOG_DIR)s/%(program_name)s/%(ENV_HOSTNAME)s-stdout.log
stdout_logfile_backups=0
stdout_logfile_maxbytes=30MB