-
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
MaxListenersExceededWarning when using containers #1620
Comments
They are all going to the same transport -- as you can see we hard-coded 30 as the max per transport before throwing warning: Unless there is a compelling argument, I'd prefer to not boost these limits again, but let me know :) |
We have multiple loggers with different labels so that we can identify which module logged the message. All loggers should log to the same FileTransport because we want all log messages in the same file. Is it safe to have multiple FileTransports that target the same file even when rolling logs are enabled? |
I am too having the same scenario as @sla89 I create a logger instance for each class I am creating (one per class, not one per class instance) and each logger has a different label. I though that having a single console and a single file transport should be used with many logger instances using them. Is that wrong? |
@ira-gordin-sap no, I don't. Everything remained the same. |
Please tell us about your environment:
winston
version?winston@2
winston@3.2.1
node -v
outputs: v8.15.1 and v10.15.3What is the problem?
Using a container that has a predefined set of transports leads to
MaxListenersExceededWarning
when adding multiple loggers:What do you expect to happen instead?
No warning.
Other information
Here is a sample repo. Simply run
node index.js
: https://github.com/sla89/winston_maxlistenersThe text was updated successfully, but these errors were encountered: