Closed gabrielbrieva closed 2 years ago
I tried the following and it didn't work.
var rollers = require('streamroller');
var stream = new rollers.RollingFileStream('myfile', 3, 0);
stream.write("abc");
stream.write("def");
stream.write("ghi");
stream.end();
Output:
myfile - ghi
myfile.1 - def
I tried the following and it now works.
Important It is also to note the file does not roll within itself (truncate its older entry for newer entry). It truncates all and appends only the new entry.
var rollers = require('streamroller');
var stream = new rollers.RollingFileStream('myfile', 6, 0);
stream.write("abc"); // add as first row
stream.write("def"); // add as second row
stream.write("ghi"); // truncate all and add as first row
stream.end();
Output:
myfile - ghi
For details, refer to https://github.com/log4js-node/streamroller/pull/74#issue-1100170368
It is possible to allow zero backups files?