1
1
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2025-01-18 08:06:16 +01:00
infrastructure/roles/nginx/files/logrotate.conf
Kristian Klausen b70d04fa5c
Send the nginx logs to Loki
A extra access_log entry was added with the following commands:
$ cd roles
$ grep -lr access_log | xargs -P 1 -n 1 sed -i '/access_log/ s/\(.*\)\( \)\(\(reduced\|main\);$\)/\1 \3\n\1.json json_\3/'
2021-04-08 20:33:43 +02:00

27 lines
494 B
Plaintext

/var/log/nginx/*/*.log {
missingok
notifempty
create 640 http log
sharedscripts
compress
size 100M
rotate 20
postrotate
test ! -r /run/nginx.pid || kill -USR1 `cat /run/nginx.pid`
endscript
}
# The json files are consumed by promtail so we don't need to keep them around for long
/var/log/nginx/*/*.json {
missingok
notifempty
create 640 http log
sharedscripts
compress
size 10M
rotate 5
postrotate
test ! -r /run/nginx.pid || kill -USR1 `cat /run/nginx.pid`
endscript
}