Skip to content

Conversation

@JamieB-gu
Copy link
Contributor

@JamieB-gu JamieB-gu commented Jan 8, 2026

The dev server doesn't currently produce any request logs. This requires two changes to fix:

  1. Include the logging middleware in the dev server.
  2. Flip the order of the log4js shutdown and configure calls. Calling shutdown after configure means nothing gets logged.

In addition, this adds a layout to the console appender to provide clearer information in the dev server logs. It also stores any errors in context for the dev server, as we do in prod, so that any erroring requests get logged at the right level ("ERROR" rather than "INFO").

Part of #13136.

Example Output

16:57:04.753 [INFO] - 200 response for web article: money/2017/mar/10/ministers-to-criminalise-use-of-ticket-tout-harvesting-software
16:57:08.765 [ERROR] - 500 response for [platform missing] front: uk/environment

The dev server doesn't currently produce any request logs. This requires
two changes to fix:

1. Include the logging middleware in the dev server.
2. Flip the order of the log4js `shutdown` and `configure` calls.
Calling shutdown after configure means nothing gets logged.

In addition, this adds a layout to the console appender to provide
clearer information in the dev server logs. It also stores any errors in
context for the dev server, as we do in prod, so that any erroring
requests get logged at the right level ("ERROR" rather than "INFO").
@JamieB-gu JamieB-gu requested a review from a team as a code owner January 8, 2026 17:18
@JamieB-gu JamieB-gu self-assigned this Jan 8, 2026
@github-actions
Copy link

github-actions bot commented Jan 8, 2026

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.

@JamieB-gu JamieB-gu added this to the Health milestone Jan 8, 2026
@JamieB-gu JamieB-gu added the maintenance Departmental tracking: maintenance work, not a fix or a feature label Jan 8, 2026
@JamieB-gu JamieB-gu added the run_chromatic Runs chromatic when label is applied label Jan 8, 2026
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Jan 8, 2026
@JamieB-gu JamieB-gu merged commit 96e00d6 into main Jan 9, 2026
27 checks passed
@JamieB-gu JamieB-gu deleted the fix-dev-logging branch January 9, 2026 13:57
@gu-prout
Copy link

gu-prout bot commented Jan 9, 2026

Seen on PROD (merged by @JamieB-gu 7 minutes and 54 seconds ago) Please check your changes!

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

Labels

maintenance Departmental tracking: maintenance work, not a fix or a feature Seen-on-PROD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants