fix: Correctly configure Log4JS when running in ECS - #16355
Merged
Merged
Conversation
Within ECS, it is common to write logs to stdout/stderr and have a sidecar process the logs. This change configures Log4JS for this. Note that there is only one appender, as it looks like the presence of a `fileAppender` causes Log4JS to attempt a `mkdir` which is currently restricted in our image. See also #16341.
The aim here is to confirm the production image works before running on AWS ECS, as its slightly easier to debug any issues locally.
akash1810
marked this pull request as ready for review
July 9, 2026 11:06
|
Hello 👋! When you're ready to run Chromatic, please apply the You will need to reapply the label each time you want to run Chromatic. |
arelra
approved these changes
Jul 9, 2026
|
Seen on PROD (merged by @akash1810 11 minutes and 25 seconds ago) Please check your changes! |
Member
Author
After being deployed, logs are still appearing in Central ELK:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Note
Recommended to review commit by commit.
What does this change?
The changes in #16341 didn't quite work. Confession, I hadn't fully tested it locally 😬. I have fully tested this branch! This is done via the new
docker-compose.yamlfile which first builds and runs the container, then makes a sample request to the application.If we run:
We (eventually) see the JSON formatted logs in stdout. Here's a screenshot from Docker Desktop:
Why?
Having logs as JSON in stdout means a sidecar (e.g. https://github.com/guardian/devx-logs/tree/main/ecs) can pick them up for processing.