fastify / fastify

Fast and low overhead web framework, for Node.js

Home Page:https://www.fastify.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`disableErrorLogging` option

erfanium opened this issue Β· comments

commented

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

πŸš€ Feature Proposal

same as currently implemented disableRequestLogging option, I need an option to disable default error logging at https://github.com/fastify/fastify/blob/f2cb21cbc8573da2d54096d414b5362d9a323fbc/lib/error-handler.js#L82:L104.

Currently, there's no way to disable these error logs without disable the logging entirely

Motivation

I need to omit certain error codes from being logged. if I able to disable the default error logger, I can implement my error logger by myself

Example

const fastify = require('fastify')

const app = fastify({
  logger: true,
  disableErrorLogging: true
})

I can work on a PR to implement this feature

commented

seams this issue has been resolved on newer fastify versions. sorry