mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
Since logrotate runs in a daily cron, this practically means "daily, but only if it's larger than 500M." For large installs with large traffic, this is effectively daily for 10 days; for small installs, it is an unknown amount of time. Switch to daily logfiles, defaulting to 14 days to match nginx; this can be overridden using a zulip.conf setting. This makes it easier to ensure that access logs are only kept for a bounded period of time.
19 lines
357 B
Plaintext
19 lines
357 B
Plaintext
/var/log/nginx/*.log {
|
|
daily
|
|
missingok
|
|
rotate <%= @access_log_retention_days %>
|
|
compress
|
|
delaycompress
|
|
notifempty
|
|
create 0640 zulip adm
|
|
sharedscripts
|
|
prerotate
|
|
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
|
|
run-parts /etc/logrotate.d/httpd-prerotate; \
|
|
fi \
|
|
endscript
|
|
postrotate
|
|
invoke-rc.d nginx rotate >/dev/null 2>&1
|
|
endscript
|
|
}
|