dnsmasq.log not being rotated

Expected Behaviour:

The file /var/log/pihole/dnsmasq.log should be rotated regularly. It used to happen every night, at midnight. Other logs are rotated

Actual Behaviour:

The file /var/log/pihole/dnsmasq.log just keeps growing. The command 'ls -ltrh /var/log/pihole/dns*' shows

-rw-r----- 1 pihole pihole 360K Jul 2 00:00 dnsmasq.log.5.gz
-rw-r----- 1 pihole pihole 344K Jul 3 00:00 dnsmasq.log.4.gz
-rw-r----- 1 pihole pihole 144K Jul 4 00:00 dnsmasq.log.3.gz
-rw-r----- 1 pihole pihole 322K Jul 6 00:00 dnsmasq.log.2.gz
-rw-r----- 1 pihole pihole 3.8M Jul 7 00:00 dnsmasq.log.1
-rw-r----- 1 pihole pihole 163M Aug 23 15:26 dnsmasq.log

so it seems logrotate stopped processing this file on 7 July.

I have inspected /opt/pihole/piholeLogFlush.sh and could find no reference to dnsmasq.log. Many of the files in /opt/pihole, including this one, were touched on 7 July. Some files in /etc/pihole were touched at the same time.

I can find no reason why dnsmasq.log is treated differently to the other pihole logs.

How do I enable logrotate on dnsmasq.log? Is there any way of detecting what changed on 7 July?

Raspberry Pi 3B running Raspbian GNU/Linux 12 (bookworm).

My Pi-hole v6 has no such log at that path. I do not remember if v5 had such a log. Are you on v5? Or perhaps upgraded to v6 from v5, which might explain the lack of rotation now? You might check the /etc/logrotate.d/pihole file for the current configuration on your system.

Pi-hole uses /var/log/pihole/pihole.log instead of /var/log/pihole/dnsmasq.log as a default for files.log.dnsmasq. You can inspect the logrotate file at /etc/pihole/logrotate (pre core v6.4.3) or /etc/logrotate.d/pihole (core v6.4.3+)

Edit: looking at commit Merge commit from fork · pi-hole/pi-hole@18002bf · GitHub which changed the location of the logrotate file, there doesn’t seem to be any migration of the old config. Instead, always the default config is installed. I suspect you had previously edited /etc/pihole/logrotate, which is no longer used. The release of this commit, with core v6.4.3, happened on the sixth of July. This lines up with your reported date of the seventh of July. You will need to change the path to your custom path inside /etc/logrotate.d/pihole

Thank you both for your thoughts. After inspecting lots of files, I found a line in /etc/pihole/pihole.toml that I must have changed.

I now have

dnsmasq = "/var/log/pihole/pihole.log"

and it seems to be working. I will be completely confident tomorrow, if the nightly logrotate is successful.