You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Descriptors for already deleted files are not released with intensive logging and standard rotation, which causes a disk space leak.
What version of Winston presents the issue?
v3.8.2
What version of Node are you using?
v18.12.1
If this worked in a previous version of Winston, which was it?
No response
Minimum Working Example
'use strict';constMAX_SIZE=2000;constMAX_FILES=3;constTIMEOUT_MS=100;constwinston=require('winston');const{format}=require('logform');constpath=require('path');const{combine, timestamp, json}=format;// Set up file transport - I assume logs folder existsconstlogsDir=path.resolve(process.cwd(),'./logs');constfilePath=path.join(logsDir,'example.log');constfileTransport={tailable: true,maxsize: MAX_SIZE,maxFiles: MAX_FILES,filename: filePath,handleExceptions: false,level: 'debug',};fileTransport.format=combine(timestamp({format: 'YYYY-MM-DD HH:mm:ss.SSS'}),json(),);// Create logger with file transportconstlogger=winston.createLogger({transports: [newwinston.transports.File(fileTransport)],exitOnError: false,});logger.log('info','Created file logger');// Add periodic logs so that files are rotatedleti=0;functiontimeoutLogger(){i++;logger.log('info','another log message '+i);logger.log('error','error message '+i);logger.log('http','http log message '+i);logger.log('verbose','verbose log message '+i);logger.log('debug','debug log message '+i);}setInterval(timeoutLogger,TIMEOUT_MS);
Running the test
node --trace-warnings example.js
(node:272) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 31 end listeners added to [PassThrough]. Use emitter.setMaxListeners() to increase limit
at _addListener (node:events:587:17)
at PassThrough.addListener (node:events:605:10)
at Readable.on (/test/node_modules/readable-stream/lib/_stream_readable.js:745:33)
at PassThrough.once (node:events:649:8)
at Readable.pipe (/test/node_modules/readable-stream/lib/_stream_readable.js:583:58)
at WriteStream.<anonymous> (/test/node_modules/winston/lib/winston/transports/file.js:553:16)
at WriteStream.emit (node:events:513:28)
at node:internal/fs/streams:75:16
at FSReqCallback.oncomplete (node:fs:197:23)
List running processes
# ps -ef
PID USER TIME COMMAND
272 root 0:00 node --trace-warnings example.js.
....
🔎 Search Terms
Descriptors to deleted files
The problem
Descriptors for already deleted files are not released with intensive logging and standard rotation, which causes a disk space leak.
What version of Winston presents the issue?
v3.8.2
What version of Node are you using?
v18.12.1
If this worked in a previous version of Winston, which was it?
No response
Minimum Working Example
Running the test
List running processes
Show unreleased FDs
Additional information
No response
The text was updated successfully, but these errors were encountered: