Move PiHole log files to a dedicated /var/log/pihole subdirectory

Is there any way that I can move all PiHole specific log files to a dedicated (sub)directory?

It seem that all log file are created under the generic base directory /var/log as depicted with:

-rw-r--r--   1 root     pihole            57036 Mar 21 11:58 pihole_debug.log
-rw-r--r--   1 pihole   pihole                0 May  6 00:00 pihole-FTL.log
-rw-r--r--   1 pihole   pihole              422 May  6 00:00 pihole-FTL.log.1
-rw-r--r--   1 pihole   pihole              283 May  5 00:00 pihole-FTL.log.2.gz
-rw-r--r--   1 pihole   pihole              245 May  4 00:00 pihole-FTL.log.3.gz
-rw-r--r--   1 pihole   pihole           329403 May  6 09:14 pihole.log
-rw-r--r--   1 pihole   pihole          5475768 May  6 00:00 pihole.log.1
-rw-r--r--   1 pihole   pihole           587470 May  5 00:00 pihole.log.2.gz
-rw-r--r--   1 pihole   pihole           626803 May  4 00:00 pihole.log.3.gz
-rw-r--r--   1 pihole   pihole           457912 May  3 00:00 pihole.log.4.gz
-rw-r--r--   1 pihole   pihole           729987 May  2 00:00 pihole.log.5.gz
-rw-r--r--   1 root     root               8259 May  1 04:47 pihole_updateGravity.log

Ideally I like to have them placed under a dedicated subdirectory like /var/log/pihole so that I can then later mount this subdirectory onto a dedicated "RAM space".

I envisage to create a dedicated RAM space with the folder2ram tool to extent the life of the SD card.

If above cannot be configured manually, can this request be taken into consideration for the next update or release of PiHole?

Read the documentation and this topic from DL6ER: Moving the Pi-hole log to another location/device - FAQs - Pi-hole Userspace

1 Like

For completeness, there is a pull request do move Pi-hole logs into a sub directory OOTB: Utilise /var/log/pihole/ for log storage by PromoFaux · Pull Request #3732 · pi-hole/pi-hole · GitHub

I have consulted the pull request, and this looks really great! It is good to have applications encapsulated and user their private space, separate from the OS general space.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.