When calling winston.loggers.get("category1"), if a logger with the category of "category1" is not found, it will automatically be created.
This means if we run the following code we will create 1000 separate Winston loggers.
for (let i = 0; i < 1000; i++) {
winston.loggers.get("category" + i);
}
Similarly, when any endpoint is called, the following code is run, resulting in a new Winston logger being created.
|
var loggerCategoryRandomiser = Math.floor(Math.random() * (1000000000 - 100 + 1)) + 100; |
To my knowledge, this logger is never closed, and so new Winston loggers pile up on the heap.
When calling
winston.loggers.get("category1"), if a logger with the category of"category1"is not found, it will automatically be created.This means if we run the following code we will create 1000 separate Winston loggers.
Similarly, when any endpoint is called, the following code is run, resulting in a new Winston logger being created.
cybersource-rest-client-node/src/authentication/logging/Logger.js
Line 26 in 31baaba
To my knowledge, this logger is never closed, and so new Winston loggers pile up on the heap.