mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-01-03 15:05:01 -05:00
fix(api): add req to the child logger (#59961)
This commit is contained in:
committed by
GitHub
parent
ff38233f96
commit
fada6f08f8
@@ -15,7 +15,7 @@ const fourOhFour: FastifyPluginCallback = (fastify, _options, done) => {
|
||||
// If the request accepts JSON and does not specifically prefer text/html,
|
||||
// this will return a 404 JSON response. Everything else will be redirected.
|
||||
fastify.setNotFoundHandler((req, reply) => {
|
||||
const logger = fastify.log.child({});
|
||||
const logger = fastify.log.child({ req });
|
||||
logger.info('User requested path that does not exist');
|
||||
|
||||
const accepted = req.accepts().type(['json', 'html']);
|
||||
|
||||
Reference in New Issue
Block a user