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.

Debug log written to stderr

See original GitHub issue

Test case:

var logger = require('winston');
logger.remove(logger.transports.Console);
logger.add(logger.transports.Console, {'timestamp': true, 'showLevel': false, 'level': 'debug'});

logger.info('info');
logger.debug('debug');
logger.error('error');

Output:

$ node test-winston.js 2>/dev/stdout 1>/dev/null
2015-02-22T11:37:59.072Z - debug: debug
2015-02-22T11:37:59.203Z - error: error

$ node test-winston.js 1>/dev/stdout 2>/dev/null 
2015-02-22T11:40:56.820Z - info: info

Expected result (disregarding the timestamp copy/paste) would be:

$ node test-winston.js 2>/dev/stdout 1>/dev/null
2015-02-22T11:37:59.203Z - error: error

$ node test-winston.js 1>/dev/stdout 2>/dev/null 
2015-02-22T11:40:56.820Z - info: info
2015-02-22T11:37:59.072Z - debug: debug

Winston version: 0.9.0, Node.js version: 0.10.18.

Issue Analytics

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

github_iconTop GitHub Comments

13reactions
briantannercommented, Sep 11, 2016

why is it a feature to spam my error logs with debug logs?

2reactions
uwefassnachtcommented, Jan 23, 2017

This behaviour is also very confusing on Cloud Foundry based platforms (e.g. IBM Bluemix). The standard debug log messages are all classified as errors 😦

Took me a while to find https://github.com/winstonjs/winston/issues/927 … which explains that it can be configured via the stderrLevels parameter (which I’ve now done). Still a bit unexpected, that the default behavior is for INFO level messages to route to stdout

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debug logs are written in stderr · Issue #3566 - GitHub
Summary The logs for debug are written in stderr instead of stdout. Dagit UI/UX Issue Screenshots Message from the maintainers: Impacted by ...
Read more >
Python logging: debug messages logged to stderr even ...
While modifying code on an existing project, I found that debug messages were being output to stderr even though the handler ...
Read more >
Focused `puts` debugging with STDERR | Ruby Inside - Medium
I'm a big fan of puts debugging when I'm trying to reproduce a particularly tricky bug, or I want to quickly get a...
Read more >
How to enable logging - The Chromium Projects
--enable-logging=stderr enables both logging to stderr and using OutputDebugStringA on Windows. Note that the sandbox prevents either form of this logging from ...
Read more >
How we use logging - Tit Petric
7 (DEBUG) - Kernel debugging messages, output by the kernel if the ... Handler } // HandleLog splits log outputs to stdout and...
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