Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow for zero backup - https://github.com/log4js-node/streamroller/pull/74 #1151

Merged
merged 1 commit into from Jan 19, 2022

Conversation

lamweili
Copy link
Contributor

@lamweili lamweili commented Jan 19, 2022

Related to log4js-node/streamroller#59, log4js-node/streamroller#74 and PR #1135

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

**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.

```javascript
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
```
@lamweili lamweili added this to the 6.4.0 milestone Jan 19, 2022
@lamweili lamweili merged commit e6bd888 into master Jan 19, 2022
8 checks passed
@lamweili lamweili deleted the feat-zero-backup branch Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant