-
Notifications
You must be signed in to change notification settings - Fork 3
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 #8
Comments
Thanks for the heads-up! Seems that this is not unusual to encounter with Winston: winstonjs/winston#1791, winstonjs/winston#1334. We may be able to mitigate this by not emitting the |
This warning is written when you have many loggers sharing a single transport. The best ways to avoid it is to use a single logger. |
i only have one logger. using module.exports = module will mean any |
Thanks for the follow-up, @daveteu - do you mean setting |
My set up is in the first post. I exported the logger as a module, wouldn't that mean I only have a single logger? You mentioned
|
@daveteu ah I see 🤔 ... yes, that's how I'd expect module exports to work. |
i believe my usage is the same as other typical users. Am i the only one with this issue? this is weird. |
@daveteu you're definitely not the only one! Unfortunately, the warning seems to appear with all Winston transports, and the exact scenario that triggers it doesn't seem to have been decisively pinned down :-( There are a lot of threads about this in the Google results for Winston MaxListenersExceededWarning; @liammclennan and I have read as many as we can, but there's still a chance an answer is out there and we've overlooked it - fingers crossed! We'll keep looking, but if you're able to spot something we've missed, any suggestions/pointers would be great. |
I will close this and reopen it if there's any further findings. |
Am I the only one getting this error?
I'm using the recommended codes on datalust/seq docs as follow, and I call it this way.
A new listener seems to be created everytime logger is called.
Error
Error occurs about 10 times after
logger.info()
is triggeredThe text was updated successfully, but these errors were encountered: