fix: respect child logger factory in fastify options#6349
Merged
Eomm merged 2 commits intofastify:mainfrom Oct 7, 2025
Merged
Conversation
gurgunday
approved these changes
Oct 4, 2025
metcoder95
approved these changes
Oct 5, 2025
Contributor
Author
|
ah, I've seen this test flake locally but it appears to be unrelated to this change (it has also failed in some other prs: https://github.com/fastify/fastify/actions/runs/18059271339/job/51393309540?pr=6229#step:5:2360, https://github.com/fastify/fastify/actions/runs/17595152215/job/49985744216?pr=6311#step:5:2342) |
Eomm
approved these changes
Oct 7, 2025
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.
Summary
Since 2695ada, fastify's initialisation options allow provision of a
childLoggerFactoryfunction as an alternative to the.setChildLoggerFactory()method for setting a child logger factory on an instance. However, this initialisation option is ignored, with the child logger factory always taking the value of thedefaultChildLoggerFactory.This change will allow provision of a child logger factory through fastify's initialiser.
I have not introduced an additional test to cover this behaviour, but have instead corrected the implementation of an existing test that was intended to cover it.
Checklist
npm run test && npm run benchmark --if-presentand the Code of conduct
Test output summary
Benchmark output