Specify log level with Node environment variable
See original GitHub issueWith 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:
- Created 4 years ago
- Reactions:2
- Comments:8 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
How about
window.localStorage.debugLevel
?Yes, exactly! 👍