Closed lyykfi closed 2 years ago
Oh interesting, is this happening during restarts of the fluentd/fluent bit process? The only thing I can think of is this logic: https://github.com/fluent/fluent-logger-forward-node/blob/master/src/socket.ts#L458 firing lots of times, but without an actual error to accompany it. Maybe this would happen on a timeout event?
Well, that or that somewhere in your code you're calling this.logger.socketOn
multiple times, but I assume you already checked that :)
I've fixed it by this walkaround:
// walkaround if ((this.logger as any)?.socket) { ;(this.logger as any).socket.setMaxListeners(5000) }
however, after a little research I've found that the problem could be related to winston. I've wrote a layout for winston@3 which use fluent-logger-forward-node
Nice :) I think I also have a fix for the issue I noticed by just removing the other event listener on completion, I'll open a PR for that soon
Thanks!. :-)
That should hopefully fix it if my guess is right, I've released v1.0.3 which should be published automatically to NPM soon. Feel free to reopen if you still see the issue in that version. Thanks for filing the bug report!
Nice! Thank you.
If you need help we also can join to developing since we use the library for our company logging :-)
Please feel free :) We initially wrote this thing for logging at my company, so glad to see it used beyond that!
Hi folks,
First of all, I want to say thank you for the project and I want to ask about an advice.
Time to time I face the error 'MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [FluentSocket]. Use emitter.setMaxListeners() to increase limit' and my config is quite straightforward.
this.logger = new FluentClient('ld', { socket: { host: url.hostname, port: parseInt(url.port, 10), }, })
Could you advice what could be a problem?