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
const winston = require('winston');
const DailyRotateFile = require('winston-daily-rotate-file');
const logger = winston.createLogger({
transports: [
new DailyRotateFile({
dirname: 'logs',
filename: 'log-%DATE%.log',
datePattern: 'YYYY-MM-DD',
zippedArchive: true,
}),
],
});
logger.info('This is a log message.');
const currentDate = new Date().toISOString().slice(0, 10);
const logFileName = `log-${currentDate}.log`;
const logFileStream = logger.transports[0].stream;
logFileStream.on('finish', () => {
console.log(`${logFileName} stream done!`); // Not working ....
});
logFileStream.end();
The text was updated successfully, but these errors were encountered:
Hawley-hy
changed the title
I want to upload the file to an S3 bucket every time the fileStream finishes writing. How can I determine when the file stream has finished writing?
How can I determine when the file stream has finished writing?
May 22, 2023
The text was updated successfully, but these errors were encountered: