feat: log rotation for stdout/stderr #953
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It closes #680
How it works
We have a log file for the Spacemesh node, based on node config. Checking every 30m file size and compress old logs to a separate file and clean up current one, rotate logs when the file will reach file size limit, right now 500 mb.
Why I didn't use https://www.npmjs.com/package/node-log-rotate
This solution for log and for rotation, we need only rotate log file, because we're logging with electron-log and second painful moment, they creating log file for us, based on timestamp and deleting this file based on this date time, we have different logic for our logs
Demo:
Screen.Recording.2022-08-19.at.22.40.35.mov