Hello ,

I Would like to Split my Varnish logs into   access log and error log file
:

I Know I can reach my goal   by command line using   varnishncsa :

---
*usr/bin/varnishncsa  -c -b -a -w /var/log/varnish/access-varnishncsa.log
-D  -f /etc/varnish/varnishncsa_logmatic.format -q 'RespStatus < 400' &&
 /usr/bin/varnishncsa  -c -b -a -w /var/log/varnish/error-varnishncsa.log
-D  -f /etc/varnish/varnishncsa_logmatic.format -q 'RespStatus > 399'*
---

I am looking now to edit my varnishncsa unit file so i can do the same
using systemd :

This is my actual  unit file with one Varnishncsa instance :
*---*



















*[Unit]Description=Varnish HTTP accelerator log
daemonDocumentation=https://www.varnish-cache.org/docs/4.1/
<https://www.varnish-cache.org/docs/4.1/>
man:varnishncsaAfter=varnish.service[Service]Type=forkingPIDFile=/run/varnishncsa/varnishncsa.pidRuntimeDirectory=varnishncsaUser=varnishlogGroup=varnishExecStart=/usr/bin/varnishncsa
 -c -b -a -w /var/log/varnish/access-varnishncsa.log -D  -f
/etc/varnish/varnishncsa_logmatic.formatExecReload=/bin/kill -HUP
$MAINPIDPrivateDevices=truePrivateTmp=trueProtectHome=trueProtectSystem=full[Install]WantedBy=multi-user.target*

---

What is the best practice to do so ?
Can I use the same  one unit file  and use a one shot exec start ? Or
should I split unit files and run two different systemd varnishncsa
services (instances)?


Regards,

Yassine Aouadi
_______________________________________________
varnish-misc mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Reply via email to