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

Log rotation or truncation for spv.log #1733

Open
fairglu opened this issue Feb 3, 2023 · 4 comments
Open

Log rotation or truncation for spv.log #1733

fairglu opened this issue Feb 3, 2023 · 4 comments

Comments

@fairglu
Copy link

fairglu commented Feb 3, 2023

What would you like to be added:

A built-in log rotation or truncation for spv.log

Why is this needed:

Just noticed my spv.log (which I had never manually purged, and had been growing for months) was 9 GB in size, as large as the "blocks" directory which contains the defi blockchain

@defichain-bot
Copy link
Member

@fairglu: Thanks for opening an issue, it is currently awaiting triage.

The triage/accepted label can be added by foundation members by writing /triage accepted in a comment.

Details

I am a bot created to help the DeFiCh developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the DeFiCh/oss-governance-bot repository.

@shohamc1
Copy link
Contributor

shohamc1 commented Feb 6, 2023

I believe you can simply delete the spv.log file when it becomes too large without having to stop the node - it will simply recreate the file and continue writing to the new empty file.

You can also set up some batch scripts to automatically delete the file once it hits a certain size.

@fairglu
Copy link
Author

fairglu commented Feb 10, 2023

Thanks, yes I'm already doing that for the debug.log, but had not noticed the spv.log was growing that much as well.

I just thought it could be a nice "quality of life automation" to have some log rotation built into the the wallet, text logs beyond a few hundred MB are quite unwieldy anyway.

@RoMi1981
Copy link

If you are on Linux use the standard logrotate configuration like:

cat /etc/logrotate.d/opn01

/opt/defichain/opn01/*.log {
size 5M
rotate 5
compress
notifempty
copytruncate
}

This works here very well. It rotates any log file in the path larger than 5 mb, keeps 5 compressed copies.

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

No branches or pull requests

5 participants