bytechefhq / bytechefhq/bytechef
Log human-readable output to the console and ECS JSON to a file in prod
- Dominant language
- Java
- Stars
- 1k
- Forks
- 170
- Avg merge
- 11h 25m
- Merged PRs (30d)
- 115
Description
Under the `prod` profile the console carries ECS JSON (`logging.structured.format.console: ecs`), so anyone reading `docker logs` or a terminal reads machine output. Move the structured stream to a file and give the console back its human-readable pattern.
### The change
`server/libs/config/logback-config/src/main/resources/logback-spring.xml` — the `prod` profile includes `console-appender.xml` alongside `structured-file-appender.xml` instead of `structured-console-appender.xml`, and the `FILE` appender is attached to the root logger under `prod` only.
`server/apps/server-app/src/main/resources/config/application-prod.yml` — `logging.structured.format.console: ecs` becomes `logging.structured.format.file: ecs`, with `logging.file.name: /opt/bytechef/server/logs/bytechef.log`.
### Open points before this can land
**Nothing collects the file.** The file is inside the container, and neither `docker-compose.yml` nor the Helm chart mounts a volume for `/opt/bytechef/server/logs`. Until something does, the structured stream that monitoring is supposed to consume is the one that leaves no trace when the container exits, while the human-readable console is what reaches `docker logs`. Worth confirming the intended consumer — a mounted volume, a sidecar, or the OpenTelemetry appender that is already on the root logger.
**Retention is uncapped.** Spring Boot's `structured-file-appender.xml` rolls at 10MB with 7 days of gzipped history and `totalSizeCap` defaulting to `0`, i.e. unlimited. A chatty deployment can fill the volume. Set `logging.logback.rollingpolicy.total-size-cap`.
**Not yet booted.** The configuration has been checked at the logback level, not by starting the server on the `prod` profile. Before merging, start it and confirm the console is human-readable, the file is ECS JSON, and no appender warning appears under `dev`, `prod` or `liquibase`.
### Done when
- prod console output is human-readable and prod file output is ECS JSON
- no `could not be found` appender warning under any profile
- the docs/compose/Helm say how the file is collected
- a retention cap is set
Contributor guide
Assessment
This issue has not been assessed yet.