Skip to content

fix: Correctly configure Log4JS when running in ECS - #16355

Merged
akash1810 merged 4 commits into
mainfrom
aa/docker-compose
Jul 9, 2026
Merged

akash1810 merged 4 commits into
mainfrom
aa/docker-compose

Conversation

@akash1810

@akash1810 akash1810 commented Jul 9, 2026 •

Copy link
Copy Markdown
Member

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.yaml file which first builds and runs the container, then makes a sample request to the application.

If we run:

docker compose up --build

We (eventually) see the JSON formatted logs in stdout. Here's a screenshot from Docker Desktop:

image

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.

akash1810 added 4 commits July 9, 2026 10:58
This reverts commit bfac6ab, reversing
changes made to d55fe31.
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 akash1810 added the fix Departmental tracking: fix label Jul 9, 2026
@akash1810 akash1810 changed the title Aa/docker compose fix: Correctly configure Log4JS when running in ECS Jul 9, 2026
@akash1810
akash1810 marked this pull request as ready for review July 9, 2026 11:06
@akash1810
akash1810 requested a review from a team as a code owner July 9, 2026 11:06
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Hello 👋! When you're ready to run Chromatic, please apply the run_chromatic label to this PR.

You will need to reapply the label each time you want to run Chromatic.

Click here to see the Chromatic project.

@arelra arelra added the run_chromatic Runs chromatic when label is applied label Jul 9, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Jul 9, 2026
@akash1810
akash1810 merged commit 0e8129a into main Jul 9, 2026
41 checks passed
@akash1810
akash1810 deleted the aa/docker-compose branch July 9, 2026 12:01
@gu-prout

gu-prout Bot commented Jul 9, 2026

Copy link
Copy Markdown

Seen on PROD (merged by @akash1810 11 minutes and 25 seconds ago) Please check your changes!

@akash1810

Copy link
Copy Markdown
Member Author

Seen on PROD (merged by @akash1810 11 minutes and 25 seconds ago) Please check your changes!

After being deployed, logs are still appearing in Central ELK:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Departmental tracking: fix Seen-on-PROD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants