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
i use rotating-file-stream to rotate log. After rotate, test.json.log will empty.
now I need that test.json.log save 7d log data, how can i do?
like winston.transports.DailyRotateFile createSymlink and symlinkName
const stream = createStream(generator, {
path: './', // Specifies the base path for files
interval: '1d', // Specifies the time interval to rotate the file
maxSize: '200M', // Specifies the maximum size of rotated files to keep
maxFiles: 7 // Specifies the maximum number of rotated files to keep
});
The text was updated successfully, but these errors were encountered:
ATM there is no option to create a symlink; I could take the occasion to add this feature, but in this period I'm so busy, it's possible I'm not able to start working on it in the next two weeks.
I'm sorry I'm not sure I got the point of the first two lines of the request; could it be that interval: '7d' is what you are looking for? If that's not the case, please feel free to ask.
emmmm, I had hoped not to empty the test.json.log after rotating. And provide an option to specifies the maximum days of test.json.log to keep.
I'd like to confirm that test.json.log similar winston.transports.DailyRotateFile createSymlink and symlinkName?
i use rotating-file-stream to rotate log. After rotate, test.json.log will empty.
now I need that test.json.log save 7d log data, how can i do?
like winston.transports.DailyRotateFile createSymlink and symlinkName
const rotatingFileStream = require('rotating-file-stream');
const { createStream } = rotatingFileStream;
const pad = (num) => (num > 9 ? '' : '0') + num;
const generator = (time) => {
if (!time) return 'test.json.log';
const year = time.getFullYear();
const month = pad(time.getMonth() + 1);
const day = pad(time.getDate());
return
test-${year}-${month}-${day}.json.log
;};
const stream = createStream(generator, {
path: './', // Specifies the base path for files
interval: '1d', // Specifies the time interval to rotate the file
maxSize: '200M', // Specifies the maximum size of rotated files to keep
maxFiles: 7 // Specifies the maximum number of rotated files to keep
});
The text was updated successfully, but these errors were encountered: