This issue has been closed, but running the following code (which I also posted here) still stops Winston logs from working within a second or so:
"use strict";
let winston = require('winston');
const myFormat = winston.format.printf(info => {
return `${info.timestamp} ${info.level}: ${info.message}`;
});
const logger = winston.createLogger({
level: 'info',
format: winston.format.timestamp(),
transports: [
new winston.transports.File({filename: 'logs/combined.log'}),
new winston.transports.Console({format: winston.format.combine(winston.format.timestamp(), myFormat), level: 'debug'})
]
});
while (true) {
let random_string = Math.random().toString(36).substring(7);
logger.info(random_string); // This one stops after a while
console.log(random_string); // while this one continues to function properly
}
Please tell us about your environment:
winston@3.0.0
node -v
outputs:v8.10.0
Ubuntu 18.04
ES6
This issue has been closed, but running the following code (which I also posted here) still stops Winston logs from working within a second or so: