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.

Specify log level with Node environment variable

See original GitHub issue

With NODE_DEBUG it’s possible to specify logger names which should be active. Is there also a setting to specify the log level?

For example, I would like to see only logs from “foo” which have log level “warning” or “error” but no “debug”, “info” and/or “log”.

I would like to set something like:

NODE_DEBUG=foo NODE_DEBUG_LEVEL=error,warn node example/node.js

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bennycodecommented, Mar 2, 2020

How about window.localStorage.debugLevel?

0reactions
bennycodecommented, Mar 4, 2020

Yes, exactly! 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting loglevel in environment variable in node - Stack Overflow
I saw a few weeks back a function/module in nodejs where you could set an environment variable to decide the loglevel and filtering, ......
Read more >
A Guide to Node.js Logging - Twilio
Learn how you can take your Node.js logging in your library, application or CLI from "console.log" to the next level using libraries like ......
Read more >
allow setting logLevel based on env variable #124 - GitHub
But I believe that's the reason the env var LOG_LEVEL exists, so many programs run with the same log level, where the user...
Read more >
Node.js Logging – How to Get Started - Papertrail
The built-in console module in Node.js lets you write log messages to standard output (stdout) and standard error (stderr)using the log and error...
Read more >
Changing log level at runtime using Winston logger
Below is the simple Node Express program and '/' route has the code to update environment variables. Basically we are reading the .env...
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