Cookbooks
varnish
documentation
Varnish Log

Back to resource list

varnish_log

Configures varnishlog or varnishncsa service. You can define both logfiles by calling varnish_log more than once. You can install logrotate config files if you wish as well.

Actions

ActionDescription
:configureconfigures the varnishlog or varnishncsa service

Properties

NameTypeDefault
file_nameString'/var/log/varnish/varnishlog.log'
pidString'/var/run/varnishlog.pid'
log_format'varnishlog' or 'varnishncsa''varnishlog'
ncsa_format_stringString`'%h | %l | %u | %t | "%r" | %s | %b | "%{Referer}i"
instance_nameStringname property
logrotatetrue, falsetrue vanishlog, false for varnishncsa
major_versionMinor supported releaseCurrently installed major version (If varnish isn't installed yet then you will have to set this explicitly)
logrotate_pathString'/etc/logrotate.d' if varnishncsa is used otherwise nil

Examples

# Configure varnishlog service
varnish_log 'default'
 
# Configure varnishncsa service
varnish_log 'default_ncsa' do
  log_format 'varnishncsa'
end