-
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
"level" option to transports appears to have no effect #202
Comments
same issue here. But there is different behaviour for File and Console transports: File logs everything no matter what level is set to. |
I actually worked out what the problem is here - the default set of levels is just in a strange order, but you can configure them differently. It's not a bug in winston, just an odd default. The default set is in
Which makes very little sense to me since I changed my loggers to use
You can pass a
Now you can set the level to |
ok, makes sense. syslog levels are so ingrained I didn't even think to question it. thanks for documenting that, big help |
This stumped me too. For future reference, this stems from npmlog, which uses these strange log levels: https://github.com/isaacs/npmlog |
+1 /stops banging head on keyboard now. Plus what @garth shows in this gist. https://gist.github.com/2570757 This must be a bug. |
Bumped into this also. It feels so wrong and confusing! Should be documented at least. |
+1. Spent 15 mins trying to fix this today. This is bizarre. |
I think the default should be changed, it seems that a lot of people are being stumped by these odd defaults |
It seems to me the http transport needs this line in the constructor, similar to the console transport: as well as this near the top: |
Maybe I've misunderstood this feature, but when I pass a "level" option to a transport, I expect it to restrict output to that level or higher (or perhaps to that level only).
Instead, it logs everything, include calls to
logger.debug
. Is there actually a way to restrict logging to a certain level? As an example use case, I want to see debug messages in development, but keep those out of production logs.The docs seem to indicate that this should work the way I expect though:
The text was updated successfully, but these errors were encountered: