Pihole doesn't flush logs

I'm having an issue with the pihole not flushing the log daily. Running the command pihole -f doesn't give any error (says done), but also does not flush the log. Same for running the command from the web admin (The Pi-Hole log file has been flushed). My log file is currently 123mb and growing!

I've also run the pihole -r (repair) command and see no errors.

Debug: vdh5doju6q

Our debug system is more concerned with the generation of debug statements for DNS problems (which you don't have), so we have to go the slow route.

Is there some output if you manually run

sudo /usr/sbin/logrotate --force /etc/pihole/logrotate

?

Hello, thank you for the help!

Nope, no output when I run that command.

Hmm, what about

cat /var/lib/logrotate/status 

You could also try

sudo /usr/sbin/logrotate -d -v --force /etc/pihole/logrotate

Actually I just figured it out!

I went and took a look at the owner & permissions for /etc/pihole to see if there was anything funky, and realized a while back I ran chown -R to that directory to my user account (stupid I know, just getting familiar with linux and thought it would make it easier for me to edit adlists.list).

I ran sudo chown -R root /etc/pihole and everything is working properly.

Sorry for wasting your time, and thanks for the help!

No worries, you didn't waste our time. Think of the user who will have eventually something similar and can safe hours of troubleshooting due to our small conversation :slight_smile:

1 Like

Hello,
I've been using PiHole for about a week, and I have not even got to delete the records at the end of the day.

Where is the error? Where do I set how often to delete my records :slight_smile:

Thank you

The latest version actually does a rolling 24 hours, and the next release will specify that better. Do you see more than 24 hours of logs?

I see this now :slight_smile:

That looks as it should be. We're working on fixing the wording.

I would not say. I've had similar values for two days.
I have PiHole on two Raspberries, let's see if both of them are deleted at 00:00.

That image shows that it is working correctly - there is a 24hr rolling window of queries. If it goes beyond that 24hrs (without telling FTL to do so), then it would be working incorrectly. You can switch to the previous behavior of flushing everything at midnight by adding this line to /etc/pihole/pihole-FTL.conf:

TIMEFRAME=today

Config documentation

I created the file, I want to save it but I have no rights. Why ?

Run this on the pi:

sudo nano /etc/pihole/pihole-FTL.conf

It is much simpler to just edit via SSH.

well, thank you. File created.

I will wait until tomorrow if I delete it.

Hello,

works!

But, why does not it erase since midnight?

Thank you

Did your pi restart at that time? It's also set to run that on reboot.

Check your time zone on your Pi-hole. It may think midnight is when you have 02:00. The displayed time in the graphs always show the time with respect to the time zone on the viewing (not the graph generating) machine for the sake of convenience. By this, the graph you see is always in your local time zone.

1 Like

Thank you, I'll try it.
The Pi-Hole time zone has not been set

Then it might be the default setting that may be, by chance, two hours off.