Skip to content
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

Winston builder complains about MaxListenersExceededWarning #9

Closed
adenhertog opened this issue May 10, 2019 · 1 comment
Closed

Winston builder complains about MaxListenersExceededWarning #9

adenhertog opened this issue May 10, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@adenhertog
Copy link
Contributor

adenhertog commented May 10, 2019

The logger factory builds a logger per IoC target, and when there are more than 10 targets then node will display the following warning:

MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 31 unpipe listeners added. Use emitter.setMaxListeners() to increase limit

This is because each logger instance defines its own console transport that internally adds listeners. This is related to: winstonjs/winston#1334

That ticket "resolves" the issue by increasing the number of listeners, which just kicks the can down the road. Instead, this fix should attempt to use a singleton logger, but configured to log the target name depending on the logging source.

@adenhertog adenhertog added the bug Something isn't working label May 10, 2019
@adenhertog
Copy link
Contributor Author

fixed by #13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant