Skip to content

Add task to truncate Rails logs

Markus Koller requested to merge truncate-logs-before-update into main

What does this Merge Request do and why?

Users sometimes run into disk space problems because these logs just keep growing forever. This adds a Makefile task to truncate them, and documents how to add this as a hook before every gdk update.

Slack thread for context (internal): https://gitlab.slack.com/archives/C2Z9A056E/p1634715463051200

Manual testing

  1. Check sizes with du gitlab/log/*
  2. Run tail -f gitlab/log/development.log in a separate terminal
  3. Run gdk update (you can abort after the hooks have run)
  4. Check sizes with du gitlab/log/* (should all be 0 now)
  5. See the message tail: log/development.log: file truncated
  6. Run rails console to see that logging still works and tail picks it up again

Merge Request checklist

  • This change is backward compatible. If not, please include steps to communicate to our users.
  • Tests added for new functionality. If not, please raise Issue to follow-up.
  • [-] Documentation added/updated, if needed.
  • [-] gdk doctor test added, if needed.
  • Add the ~highlight label if this MR should be included in the CHANGELOG.md.
Edited by Markus Koller

Merge request reports

Loading