I have a daily limit of files of 10. if that limit reaches audit.json gets updated but files from windows are not getting deleted until the application restart and that file is not accessible getting an EPERM error.
EPERM: operation not permitted, open 'C:\FLOW2\PM2\logs\engine_out-2023-03-21.log'
const { createLogger, transports, format } = require('winston');
let outTransporter = new (transports.DailyRotateFile)({
level: 'trace',
levelOnly: false,
filename: microServiceName +'_out-%DATE%.log',
dirname: logPath,
datePattern: rotationPattern,
maxSize: maxSize,
maxFiles: maxFiles,
auditFile: auditFilePath
});
let errorTransporter = new (transports.DailyRotateFile)({
level: 'error',
levelOnly: true,
filename: microServiceName +'_error-%DATE%.log',
dirname: logPath,
datePattern: rotationPattern,
maxSize: maxSize,
maxFiles: maxFiles,
auditFile: auditFilePath
});
I guess this is related to this https://github.com/winstonjs/winston-daily-rotate-file/issues/261
I have a daily limit of files of 10. if that limit reaches audit.json gets updated but files from windows are not getting deleted until the application restart and that file is not accessible getting an EPERM error.
EPERM: operation not permitted, open 'C:\FLOW2\PM2\logs\engine_out-2023-03-21.log'
const { createLogger, transports, format } = require('winston'); let outTransporter = new (transports.DailyRotateFile)({ level: 'trace', levelOnly: false, filename: microServiceName +'_out-%DATE%.log', dirname: logPath, datePattern: rotationPattern, maxSize: maxSize, maxFiles: maxFiles, auditFile: auditFilePath }); let errorTransporter = new (transports.DailyRotateFile)({ level: 'error', levelOnly: true, filename: microServiceName +'_error-%DATE%.log', dirname: logPath, datePattern: rotationPattern, maxSize: maxSize, maxFiles: maxFiles, auditFile: auditFilePath }); I guess this is related to this https://github.com/winstonjs/winston-daily-rotate-file/issues/261