graphene-os-server-infrastr.../etc/logrotate.d/nginx
Daniel Micay 2caa67529a set up syslog-ng for nginx access log
This sets up the infrastructure for moving from storing nginx access
logs in journald to plain text files written by syslog-ng and rotated by
logrotate. This works around the poor performance, poor space efficiency
and lack of archived log compression for journald. Unlike writing access
logs directly with nginx, this continues avoiding blocking writes in the
event loop and sticks to asynchronous sends through a socket.

Since nginx only supports syslog via the RFC 3164 protocol rather than
the more modern RFC 5424 protocol, this leaves formatting timestamps up
to nginx rather than using the ones provided via the syslog protocol.
2025-11-03 00:33:28 -05:00

11 lines
193 B
Text

/var/log/nginx/*log {
missingok
notifempty
create 600 root root
sharedscripts
compress
maxsize 2G
postrotate
syslog-ng-ctl reopen >/dev/null
endscript
}