-
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
Logger level doesn't update transports level #1191
Labels
Bug
Good First Issue
Good issue for new contributors
Help Wanted
Additional help desired from the community
Important
Comments
emmanueldiaz
changed the title
Logger level doesn't update transport level
Logger level doesn't update transports level
Jan 25, 2018
This is a fair point. Under the covers we are using the |
indexzero
added
Important
Good First Issue
Good issue for new contributors
Help Wanted
Additional help desired from the community
labels
Apr 22, 2018
This was referenced Apr 26, 2018
ChrisAlderson
added a commit
that referenced
this issue
May 24, 2018
Merged
indexzero
pushed a commit
that referenced
this issue
Jun 5, 2018
indexzero
pushed a commit
that referenced
this issue
Jun 12, 2018
* [fix] Update level property to change transport level #1191 * [test] Add a test case for Logger level setting transports level * [test] tiny change in testcase for Logger level setting transports level * [refactor test] Remove need for getter and setter now that we check a live reference to the parent in `winston-transport`. Refactor the test to ensure that `"pipe"` has been handled by the child before proceeding. * [dist] Bump to `winston-transport@4.2.0`
Mizumaki
pushed a commit
to Mizumaki/winston
that referenced
this issue
Jun 11, 2020
…winstonjs#1328) * [fix] Update level property to change transport level winstonjs#1191 * [test] Add a test case for Logger level setting transports level * [test] tiny change in testcase for Logger level setting transports level * [refactor test] Remove need for getter and setter now that we check a live reference to the parent in `winston-transport`. Refactor the test to ensure that `"pipe"` has been handled by the child before proceeding. * [dist] Bump to `winston-transport@4.2.0`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bug
Good First Issue
Good issue for new contributors
Help Wanted
Additional help desired from the community
Important
I have a scenario where I need multiple loggers in a winston instance.
So let's say you have this code:
At this point
category1.level
isinfo
because it is the default level assigned to the logger.So, if we run
testLogger()
we won't see the debug message.Let's say that we want to change the logging level to
error
. If we docategory1.level = 'error'
nowcategory1.level
will beerror
, buttestLogger()
will still showinfo
,warn
anderror
messages.In order to get
category1
to only showerror
we would need to assigncategory1.transports[0].level = error
.Shouldn't just changing the logger level directly affect the logging level of the attached transports?
If this the expected behavior, then what is the purpose of having a level for the logger itself?
The text was updated successfully, but these errors were encountered: