Prerequisites
Fastify version
4.26.2
Plugin version
No response
Node.js version
v20.11.1
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
14.4.1
Description
I am trying to have a full control over the log entries Fastify writes and I noticed that in the default error handler it writes records without checking the disableRequestLogging value.
Should it check if and disable logging when it is true or is it preferred to set a custom error handler to prevent it?
Steps to Reproduce
import fastify from 'fastify';
const server = fastify({
disableRequestLogging: true
});
server.get('/ping', async (request, reply) => {
throw new Error('err');
})
server.listen({ port: 8080 }, (err, address) => {
if (err) {
process.exit(1)
}
})
Expected Behavior
No log entries added when an error is managed by the default error handler
Prerequisites
Fastify version
4.26.2
Plugin version
No response
Node.js version
v20.11.1
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
14.4.1
Description
I am trying to have a full control over the log entries Fastify writes and I noticed that in the default error handler it writes records without checking the
disableRequestLoggingvalue.Should it check if and disable logging when it is
trueor is it preferred to set a custom error handler to prevent it?Steps to Reproduce
Expected Behavior
No log entries added when an error is managed by the default error handler