question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

req.logger/res.logger `silent` option in Express?

See original GitHub issue

I have a healthcheck route for my loadbalancers to ping our core service.

I’d like to pass something like res.logger({ axe: {silent: true }}) to the route, in order to silence that specific message.

Is there any such ignore pattern for Express + CabinJS to achieve this on a specific route, rather than injecting a logger into every route? That is to say, is there an easy opt-out on a per-route basis, with a globally configured logger

Thank you! 😃

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
titanismcommented, Nov 15, 2022

I think the approach where if the message is undefined or null it would be useful. Let’s do that. Implementing it now, one moment.

1reaction
smashahcommented, Nov 16, 2022

Thanks for the rapid turnaround @titanism much appreciated!

Read more comments on GitHub >

github_iconTop Results From Across the Web

pinojs/pino-http: high-speed HTTP logger for Node.js - GitHub
This function will be invoked to determine the level at which the log should be issued ( silent will prevent logging). This option...
Read more >
How to disable HTTP request logs in Node/Express.js
How to disable HTTP request logs in Node/Express.js · 6. Move the logging pluggin below the resource pluggin in the app initialization. Done....
Read more >
How to Implement Logging in a Node.js Application With Pino ...
The first option passed in the function is the logger itself that depicts the loggerService that you created earlier. The second option is ......
Read more >
A Complete Guide to Pino Logging in Node.js - Better Stack
Learn how to start logging with Pino in Node.js and go from basics to best practices in no time.
Read more >
A Guide to Node.js Logging - Twilio
const express = require('express'); const PORT = process.env.PORT || 3000; const app = express() ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found