Skip to content

Instantly share code, notes, and snippets.

@nrr
Created August 1, 2013 18:25
Show Gist options
  • Save nrr/6133882 to your computer and use it in GitHub Desktop.
Save nrr/6133882 to your computer and use it in GitHub Desktop.
Wanna chunk nginx logs into multilog/svlogd? Well, here's kinda how you do that.
/var/log/nginx/*.log {
hourly
missingok
rotate 24
compress
delaycompress
notifempty
create 640 nginx adm
sharedscripts
postrotate
[ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`
endscript
}
#! /usr/bin/env bash
exec chpst -ulog svlogd -t ./main
# optionally, use lumberjack to ship logs somewhere with each rotation
#exec chpst -ulog svlogd -t ./main !"lumberjack -config ./root/lumberjack.json"
#! /usr/bin/env bash
exec tail -qf -n 0 /var/log/nginx/*.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment