logrotate is the standard Linux tool for keeping log files from growing forever — it periodically renames, compresses, and prunes old logs based on a config in /etc/logrotate.d/, usually run once a day via cron/systemd timer. Pick your options below and get a ready-to-use config stanza, plus a plain-English explanation of exactly what each line does. Runs entirely in your browser.
Save this as its own file under /etc/logrotate.d/ (e.g. /etc/logrotate.d/myapp) — no need to touch /etc/logrotate.conf itself. Test it without waiting for cron: logrotate -d /etc/logrotate.d/myapp (dry run) or logrotate -f /etc/logrotate.d/myapp (force a real rotation now).
curl -sS -X POST https://devops.majbase.com/logrotate-builder/api -H "Content-Type: application/json" -d '{"log_path":"/var/log/myapp/*.log","frequency":"daily","rotate_count":14,"compress":true,"delaycompress":true,"missingok":true,"notifempty":true,"create_enabled":true,"create_mode":"0640","create_owner":"www-data","create_group":"adm","postrotate_command":"systemctl reload nginx"}'
Returns {"config": "...", "explanation": [{"directive", "description"}, ...]}, or {"error": "..."}.
Want an AI agent (Claude Code, claude.ai, or anything else that supports the Agent Skills format) to use this tool for you on request? Download the skill below and add it:
~/.claude/skills/logrotate-builder/SKILL.md