MaxListenersExceededWarning when using containers
See original GitHub issuePlease tell us about your environment:
winston
version?-
winston@2
-
winston@3.2.1
-
- _
node -v
outputs: v8.15.1 and v10.15.3 - _Operating System? Linux 16.04 and Windows 10
What is the problem?
Using a container that has a predefined set of transports leads to MaxListenersExceededWarning
when adding multiple loggers:
$ node index.js
(node:8512) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 31 unpipe listeners added. Use emitter.setMaxListeners() to increase limit
(node:8512) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 31 error listeners added. Use emitter.setMaxListeners() to increase limit
(node:8512) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 31 drain listeners added. Use emitter.setMaxListeners() to increase limit
(node:8512) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 31 close listeners added. Use emitter.setMaxListeners() to increase limit
(node:8512) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 31 finish listeners added. Use emitter.setMaxListeners() to increase limit
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_maxlisteners
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Gatsby / Docker causes MaxListenersExceededWarning
I am having a really weird issue here. Firstly when I run local build on my pc with Gatsby Build I don't have...
Read more >Possible EventEmitter memory leak detected" nodejs - Server ...
Use emitter.setMaxListeners() to increase limit (node:1584) MaxListenersExceededWarning: Possible EventEmitter memory leak detected.
Read more >Possible EventEmitter memory leak detected - Bitbucket
Since a couple of days I see that my poste docker is using 100% CPU load. ... (node:1108) MaxListenersExceededWarning: Possible EventEmitter ...
Read more >Actions execution throws "MaxListenersExceededWarning"
(node:18) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [Socket]. Use emitter.
Read more >Node.js Memory Leak Detection: How to Debug & Avoid Them
Learn what Node.js memory leaks are. Discover common causes and go through the whole debugging process, from detection to fixing and ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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?