# Logrotate

Logrotate is a self-hosted monitoring & logging app. A Docker container that runs logrotate to automatically rotate, compress, and remove log files for a Vitess database deployment. It is open source and self-hosted, installable on Docker Hub.

Canonical page: https://ourlocalhost.com/app/5848/logrotate

## Description

A Docker container that runs logrotate to automatically rotate, compress, and remove log files for a Vitess database deployment.

## Platform availability

Available on 0 of 10 platforms.

## Health score

64/100 (Good), based on 4 of 5 factors.
- Maintained: 74 (last commit 80 days ago)
- Popular: 64 (1,556 GitHub stars)
- Easy to install: 25 (0 install platforms, install notes, Docker image)
- Security check: 81 (no serious findings, CI, tests, OpenSSF Scorecard 6.1/10)

## Links

- Docker Hub: https://hub.docker.com/r/vitess/logrotate
- GitHub: https://github.com/logrotate/logrotate

## Common questions

### How do I make logrotate run automatically on a schedule?

Enable and start the systemd timer with sudo systemctl enable logrotate.timer and sudo systemctl start logrotate.timer. Without the timer, logs may not rotate until you run logrotate manually.

### Which logrotate file should I back up to avoid rotation problems after a move?

Back up /var/lib/logrotate/status, because it remembers when each log was last rotated and which backup number is next. If lost, logrotate can rotate wrong files, skip backups, or create unexpected filenames.

### What should I check in the logrotate config before the first real run?

Review /etc/logrotate.conf and make sure it includes /etc/logrotate.d, which holds extra rules for apps. Without the right config, logrotate may miss important logs or use defaults that do not fit your system.

### What Docker options are available for log rotation?

You can use an external logrotate container, but that may cause concurrent access issues, or install logrotate within each container if it is available. Another option is to use Docker logs with configured rotation instead of application logs.

---
Source: Our Local Host (https://ourlocalhost.com/app/5848/logrotate), the self-hosted and open-source app directory.
