logrotate Config Generator
Generate a logrotate rule: frequency, how many to keep, size limit, compression, date suffixes, ownership and copytruncate or a postrotate reload.
Free · No sign-up · Your inputs stay in your browser
Input
Generate a logrotate config
Output
/etc/logrotate.d/app
190 characters
Test with logrotate -d /etc/logrotate.d/app (dry run), then force one rotation with -f. copytruncate suits PHP apps that open the log per request or keep it open; it can lose lines written during the copy. A daemon that reopens its log on a signal (Nginx, via postrotate) is better served by create. For Laravel, LOG_CHANNEL=daily rotates without logrotate at all.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
copytruncate or create
create renames the log and creates an empty one, which works when the program can be told to reopen its files, such as Nginx with a postrotate reload. copytruncate copies the log and truncates the original in place, for programs that keep the file open and cannot reopen it; lines written during the copy can be lost. Options are documented in logrotate(8).
Laravel needs no logrotate
With LOG_CHANNEL=daily, Laravel writes one file per day and deletes those older than LOG_DAILY_DAYS. Use logrotate for the single-file channel, or for the worker and web server logs around it.