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

Rotate dashmate log files #2124

Closed
shumkov opened this issue Sep 16, 2024 · 3 comments · Fixed by dashpay/docs#396
Closed

Rotate dashmate log files #2124

shumkov opened this issue Sep 16, 2024 · 3 comments · Fixed by dashpay/docs#396
Assignees

Comments

@shumkov
Copy link
Member

shumkov commented Sep 16, 2024

Currently, dashmate by default writes Core log and docker logs for each container. Users are experiencing problems with growing logs which is a big risk for a node liveness since logs take all available disk space and hang the host machine eventually.

This problem should be decomposed to multiple separate issues:

@shumkov shumkov self-assigned this Sep 16, 2024
@shumkov shumkov converted this from a draft issue Sep 16, 2024
@shumkov shumkov changed the title Evaluate dashmate-based log rotation Rotate dashmate logs Sep 16, 2024
@shumkov shumkov changed the title Rotate dashmate logs Rotate dashmate log files Sep 16, 2024
@shumkov
Copy link
Member Author

shumkov commented Sep 16, 2024

@thephez @lklimek @pshenmic I evaluated different approaches on how we could handle growing file logs in dashmate:

  1. NodeJS should rotate logs. There are no decent modules for NodeJS what we could use. Write and maintain own code is a bad idea. There are many pitfalls.
  2. Dashmate can’t install and control logrotate system tool so it must be done by a user. We could help to configure it though. As a first step I would add an article on how to enable log files and setup logrotate for dashmate.
  3. Run a logrotate container that will rotate logs on host machine. It sounds a bit crazy but it’s possible. In this case it will be fully automated since dashmate can run and properly configure it. I feel like it’s over-engineering.

In my opinion we should go with option 2. What are your thoughts guys?

@lklimek
Copy link
Contributor

lklimek commented Sep 16, 2024

I would say:

  • default configuration (that is, docker logs ...) should be managed by dashmate. Looks like it can be done on docker-compose.yml level, by setting some logging driver options, but I didn't do that.
  • custom configuration (eg. when user defines external file to log) should be left for the user; we can only warn the user to handle log rotation when the logging config is changed. I assume here that if the user changes configs, he knows what he's doing, and can also take care of log rotation

@shumkov
Copy link
Member Author

shumkov commented Sep 16, 2024

@lklimek then we are on the same page. This is for docker logs #2125. @thephez could you please create an article on how to enable file logging for dashmate and configure logrotate in this case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants