diff --git a/etc/logrotate.conf b/etc/logrotate.conf index 382fe5a..bf40de8 100644 --- a/etc/logrotate.conf +++ b/etc/logrotate.conf @@ -1,14 +1,8 @@ -# see "man logrotate" for details -# rotate log files daily +rotate 16 daily +maxage 10 +maxsize 16M -# keep 10 days worth of backlogs -rotate 10 - -# restrict maximum size of log files -#size 20M - -# create new (empty) log files after rotating old ones create compress @@ -18,13 +12,9 @@ compressext .zst compressoptions -9 --long delaycompress -# Logs are moved into directory for rotation -# olddir /var/log/archive - # Ignore pacman saved files tabooext + .pacorig .pacnew .pacsave -# Arch packages drop log rotation information into this directory -include /etc/logrotate.d - /var/log/wtmp /var/log/btmp {} + +include /etc/logrotate.d diff --git a/etc/logrotate.d/nginx b/etc/logrotate.d/nginx index f0e7e37..f426831 100644 --- a/etc/logrotate.d/nginx +++ b/etc/logrotate.d/nginx @@ -1,8 +1,16 @@ -/var/log/nginx/access.log /var/log/nginx/error.log { +/var/log/nginx/access.log { missingok - sharedscripts + maxsize 1G + nodelaycompress + postrotate + syslog-ng-ctl reopen >/dev/null + endscript +} + +/var/log/nginx/error.log { + missingok + maxsize 64M nodelaycompress - maxsize 2G postrotate syslog-ng-ctl reopen >/dev/null endscript