-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'debug' level is getting directed to stderr instead of stdout #927
Comments
just found related issue #556 ... still trying to understand it, but wanted to get that out there before anyone wastes too much time investigating / responding |
Found the answer here: ... i.e. setting the levels to log to stderr instead of stdout via FWIW, I didn't find it very intuitive that this option would default to I'll let someone on the project close this issue after reading this feedback, but I need no additional help. |
Debug logging does not indicate an error in my eyes. Good that it can be changed via |
Maybe I can see the sense of it, although I do not agree with it. It might make sense under the following terms:
In this case, you'll have to search for your debug notices in the file/sql/loglly, IMHO - It's a kinda twisted gotcha. I'm here just because I ran into it myself, and decided to share my observation. It's of the kind of settings that are fit to development time, and nowhere else. |
I agree that this is a very strange default setting. I'm building a system that runs commands locally, and it also runs its own commands over SSH in child processes too. And have been investigating why the local commands appeared to work (I'm not monitoring STDERR on the main local node process), but the same remote SSH commands were producing STDERR output (I'm throwing local exceptions when the child process's remote command has STDERR output). First I thought it was something to do with SSH itself handling output differently until I ran further tests to rule SSH out, and after a while thought to look into Winston. Thanks for posting this issue. This would have taken me a while longer to figure out otherwise. |
Duplicate of #1024, which will remain open. The feature has existed for a long time, but if enough folks are not happy with it then we can remove it as a breaking change in |
I think you should let the user decide. |
+1 for leaving debug out of stderr. |
Setup
Repro Steps
Save the following into a file named app.js:
Run the app with command:
node app.js > app.log 2>err.log
View the contents of err.log and notice that the
log.error
andlog.debug
output both ended up in there (former expected, latter not expected). View the contents of app.log and notice that thelog.warning
,log.notice
, andlog.info
output all ended up in there (as expected).Edit app.js to find/replace all 4 instances of 'debug' with any other word - e.g. 'debugz'.
Run the app (again) with (the same) command:
node app.js > app.log 2>err.log
Notice how all the stuff ends up in the same file, except that the
log.debugz
output is now in app.log and not in err.log.The text was updated successfully, but these errors were encountered: