[wptserve] Include server scheme in logging output #13632
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.
Because multiple server processes are started in parallel, requests logs
for each are interleaved in the parent process. Previously, they shared
the same configuration, so it was not possible to differentiate entries
added by each server process.
Use "child" loggers with names derived from the server scheme so that
each logging entry describes the server from which it originated.
Example output (starting the server, requesting http://web-platform.test:8000, then requesting https://web-platform.test:8443):
In
master
today, the use of a single logger is clearly intentional. I don't understand the motivation, so I can't tell if introducing so-called "child" loggers is somehow undesirable.The structure of the code suggests that some consumers might be supplying custom implementations of the
RequestRewriter
andRouter
classes. My preference is to avoid optional parameters when possible, but I've used them here in the interest of maintaining compatibility with those users.