Open nullromo opened 1 year ago
const fileTransportOptions: DailyRotateFileTransportOptions = { dirname: path.resolve(DATA_DIRECTORY, 'logs'), extension: '.log', filename: 'server-%DATE%', format: winston.format.combine( winston.format.timestamp({ format: TIMESTAMP_FORMAT, }), winston.format.uncolorize(), winston.format.json(), winston.format.printf((info) => { info.message = (info.message as string).trim(); return JSON.stringify(info); }), ), json: true, maxFiles: '30d', watchLog: true, // <=========================== important part here }; const fileTransport = new DailyRotateFile(fileTransportOptions);
Run the code with the options above. Delete the log file while it's running.
The file should be regenerated and the logging should continue after the file is deleted.
The file is not regenerated. I must restart my code for the log file to come back.
winston version: 3.7.2 winston-daily-rotate-file version: 4.6.1 winston-transport version: 4.5.0 system: WSL 2 node version: 18.7.0
Code Excerpt
Steps
Run the code with the options above. Delete the log file while it's running.
Expected Behavior
The file should be regenerated and the logging should continue after the file is deleted.
Actual Bahavior
The file is not regenerated. I must restart my code for the log file to come back.
System Details
winston version: 3.7.2 winston-daily-rotate-file version: 4.6.1 winston-transport version: 4.5.0 system: WSL 2 node version: 18.7.0