Skip to content

Instantly share code, notes, and snippets.

@stephen-mw
Last active December 3, 2019 11:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephen-mw/5549788 to your computer and use it in GitHub Desktop.
Save stephen-mw/5549788 to your computer and use it in GitHub Desktop.
Init and logrotate script for varnishncsa logging process
# Logrotate script for varnishnca
# /etc/logrotate.d/varnishncsa
#
/var/log/varnish/varnishncsa.log {
daily
rotate 7
missingok
compress
delaycompress
missingok
postrotate
service varnishncsa reload > /dev/null
endscript
}
# varnishncsa - Logging daemon for varnish
# /etc/init/varnishncsa
description "logging daemon for varnish"
env LOG_OPTIONS="%h %l %u %t '%r' %s %b '%{Varnish:time_firstbyte}x' %{Varnish:handling}x"
start on started varnish
stop on stopped varnish
respawn
exec /usr/bin/varnishncsa -a -F "$LOG_OPTIONS" -w /var/log/varnish/varnishncsa.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment