allow to disable lighttpd access logging

I’d like to be able to disable request logging done by lighttpd much like query logging in dnsmasq can be disabled . This is handy for running from SD card in order to make it last as long as possible.

lighttpd writes access logs to /var/log/lighttpd/access.log and it is not possible to disable this in robust way - any modification done to /etc/lighttpd/lighttpd.conf will be erased on upgrade.

I run a script that queries the local server (http://localhost/admin/api.php) every couple of seconds (to get statistics) so /var/log/lighttpd/access.log is being written into very often. This wears the SD card.

I tried to workaround it by placing accesslog.file = "/dev/null" to /etc/lighttpd/external.conf however this does not work.

After filing https://github.com/pi-hole/docker-pi-hole/issues/484 I realized that Pi-hole itself needs a capability to disable the logging before it can be implemented in Docker image.

Put your configurations in a separate file and they will not be overwritten

Could try symlink access log to NULL:

sudo mv /var/log/lighttpd/access.log /var/log/lighttpd/access.log.org

sudo ln -s /dev/null /var/log/lighttpd/access.log

sudo chown www-data:www-data /var/log/lighttpd/access.log

sudo chmod 0644 /var/log/lighttpd/access.log

EDIT: For now :wink:

EDIT2: better not or you get below when login :wink:

Last login: Tue Jul 23 15:44:38 2019 from 10.0.0.11
-bash: /dev/null: Permission denied
-bash: /dev/null: Permission denied
-bash: /dev/null: Permission denied
-bash: /dev/null: Permission denied
-bash: /dev/null: Permission denied
-bash: /dev/null: Permission denied
-bash: /dev/null: Permission denied
-bash: /dev/null: Permission denied
-bash: /dev/null: Permission denied
-bash: /dev/null: Permission denied