Pi-hole Docker: logs

The issue I am facing:
I run Pi-hole as a docker container, specifically using docker-compose and not the standalone docker run command. I have a number of questions relating to managing the logs it creates please, as follows:

  1. By default, I believe the logs are written inside the container. Does this mean the logs are still being written to the SD card (although they are deleted when the container is brought down)?

As an aim, I would like to not write to the SD card, so if the answer to Question 1 is yes, could you please advise on how to manage the logs within the container (using docker-compose)?

  1. If there is no way to manage the logs using some kind of environmental variable or argument in the docker-compose.yml file, I can obviously use volumes as follows:
  • /path/on/my/server:/var/log/
  • /path2/on/my/server:/etc/pihole/
    But again, I want not to write to the SD card.

Do you recommend creating a ramdisk or pointing the logs to /dev/null? I have tried this without success unfortunately, hence wanting to ask you for your specific recommendations. If you do recommend this, could you give specific instructions that work please?

Please note I do want to be able to log into the Pi-hole web Dashboard and see which of my systems are creating entries in Top Blocked Domains and Top Clients. Which is to say, I do not want to simply go into Pi-hole web admin > settings > System > disable query logging.

So in summary, the issue I'm facing is:
Whilst using Pi-hole docker in a docker-compose situation, how do I keep the container logging so I can see the entries for the systems in my lan, but make it so that the logs that Pi-hole creates are not writing to the SD card but instead to a fixed amount of RAM?

I do not care to keep the logs.

Details about my system:
Raspbian running on a Raspberry Pi Model 2, running docker Pi-hole using docker-compose.

What I have changed since installing Pi-hole:

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