-
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
Child logger from winston default logger #1767
Comments
I guess you are looking for a solution like this:
Output
Note, you cannot overwrite |
This looks related to PR #1989, regarding the overwriting with the same variables. |
@bobvanderlinden @wbt Per the issue author they wanted to be able to create a new child logger from the default logger instance that is exported. It appears that this was solved by #1603. As such I am closing this issue. @DABH do you know if we've cut a release and published it to NPM, that has this feature in it? If you don't know off the top of your head, that's fine and I'll confirm later. |
Yeah, we have done a release since then, so this must be included now |
Please tell us about your environment:
winston
version?winston@2
winston@3
node -v
outputs:v12.13.0
What is the problem?
The following is not possible:
While the documentation gives the following 2 statements:
See https://github.com/winstonjs/winston#creating-child-loggers
and
See https://github.com/winstonjs/winston#using-the-default-logger
However, it is not possible to call
child
onwinston
. This is inconvenient.My usecase is the following:
So that I can have the module filename in the logs.
The documentation says the following:
What do you expect to happen instead?
I expect the following to work:
The text was updated successfully, but these errors were encountered: