# How to disable logging?

**URL:** <https://discourse.pi-hole.net/t/how-to-disable-logging/422>\
**Category:** Help\
**Created:** [October 30, 2016, 1:14pm UTC](https://discourse.pi-hole.net/t/how-to-disable-logging/422 "2016-10-30T13:14:47Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon30777135](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/a/ba9def/32.png) [@anon30777135](https://discourse.pi-hole.net/u/anon30777135)\
**Post date:** [October 30, 2016, 1:14pm UTC](https://discourse.pi-hole.net/t/how-to-disable-logging/422/1 "2016-10-30T13:14:48Z")

</div>

Hi their,

I wanted to ask you how I can disable the logging of non ad domains by Pi Hole because this would make it much more secure and private.

Thank you

---

<div class="post-metadata">

**Author:** ![PromoFaux](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/promofaux/32/1545_2.png) [@PromoFaux](https://discourse.pi-hole.net/u/PromoFaux)\
**Post date:** [October 30, 2016, 1:36pm UTC](https://discourse.pi-hole.net/t/how-to-disable-logging/422/2 "2016-10-30T13:36:40Z")

</div>

Hi there,

Just had a little play with this. run the following command on a cron job every minute and it will clear out anything that isn't an ad domain.

`sudo sed -i '/gravity.list/!d' /var/log/pihole.log`

Though you're still going to see other domains in the log in between script runs, once a min is `cron`'s limit.

You could try password protecting the web-interface? Create a file called `/etc/lighttpd/external.conf` and placing auth settings in there. That said, i'm not personally up to scratch on how to do that, but @Mcat12 may have a better idea!

---

<div class="post-metadata">

**Author:** ![anon30777135](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/a/ba9def/32.png) [@anon30777135](https://discourse.pi-hole.net/u/anon30777135)\
**Post date:** [October 30, 2016, 1:46pm UTC](https://discourse.pi-hole.net/t/how-to-disable-logging/422/3 "2016-10-30T13:46:34Z")

</div>

Hi PromoFaux,  
thanks that worked. But when I now go to the query log it does not even show the domains of the blocked pages anymore 😃

But its a begging thank you. That the web interface is not password protected is not that big of an issue. Because the DNS server can only be accessed when connected to a VPN. But extra security is never a bad think 😉

Edit: But when I would like it to be a password prompt by the web interface so no htaccess or so 😃 Just as a feature request.

---

<div class="post-metadata">

**Author:** ![PromoFaux](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/promofaux/32/1545_2.png) [@PromoFaux](https://discourse.pi-hole.net/u/PromoFaux)\
**Post date:** [October 30, 2016, 1:54pm UTC](https://discourse.pi-hole.net/t/how-to-disable-logging/422/4 "2016-10-30T13:54:37Z")

</div>

Ah yeah, didn't think to check the query log page!

And that makes sense. The way we parse the logs is a bit janky right now, to say the least, once we get some back-end database support in place, it will be much easier to filter out things without breaking the front end! (`delete from queries where blocked=false`, as an example in your case)

I also noticed after I ran the `sed` command that `dnsmasq` stopped logging, and I had to restart it to get it going again, so perhaps not an ideal solution!

---

<div class="post-metadata">

**Author:** ![anon30777135](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/a/ba9def/32.png) [@anon30777135](https://discourse.pi-hole.net/u/anon30777135)\
**Post date:** [October 30, 2016, 2:05pm UTC](https://discourse.pi-hole.net/t/how-to-disable-logging/422/5 "2016-10-30T14:05:00Z")

</div>

Oh well so I will better disable to cron job for now... And wait till the update with the database backend comes out. Do you have any time frame for this maybe?

I would be very happy to test it out 🙂

---

<div class="post-metadata">

**Author:** ![PromoFaux](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/promofaux/32/1545_2.png) [@PromoFaux](https://discourse.pi-hole.net/u/PromoFaux)\
**Post date:** [October 30, 2016, 2:19pm UTC](https://discourse.pi-hole.net/t/how-to-disable-logging/422/6 "2016-10-30T14:19:00Z")

</div>

It's very pre-alpha right now... Take a look at it you like, could always use more testers.. but keep in mind that it could break at any time!

[https://github.com/pi-hole/pi-hole/pull/731](https://github.com/pi-hole/pi-hole/pull/731)

---

<div class="post-metadata">

**Author:** ![anon30777135](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/a/ba9def/32.png) [@anon30777135](https://discourse.pi-hole.net/u/anon30777135)\
**Post date:** [October 30, 2016, 2:43pm UTC](https://discourse.pi-hole.net/t/how-to-disable-logging/422/7 "2016-10-30T14:43:09Z")

</div>

thank you, well I will consider trying it 😃 But since its a productive server. pre-alpha does not sound good to use on it. Well will have to wait then...

But thank you 🙂

---

<div class="post-metadata">

**Author:** ![PromoFaux](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/promofaux/32/1545_2.png) [@PromoFaux](https://discourse.pi-hole.net/u/PromoFaux)\
**Post date:** [October 30, 2016, 2:44pm UTC](https://discourse.pi-hole.net/t/how-to-disable-logging/422/8 "2016-10-30T14:44:37Z")

</div>

I'll put it this way, I've been running it for the past month with no hiccups. As far as the actual blocking of domains goes, it works as per normal. The database additions are purely for improving the performance of the Admin page. 🙂

---

<div class="post-metadata">

**Author:** ![anon30777135](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/a/ba9def/32.png) [@anon30777135](https://discourse.pi-hole.net/u/anon30777135)\
**Post date:** [November 1, 2016, 4:15pm UTC](https://discourse.pi-hole.net/t/how-to-disable-logging/422/9 "2016-11-01T16:15:50Z")

</div>

Hi,

I just saw that a logOnlogOff branch was created. I would like to help test it if you don't mind. And maybe I am allowed to ask what exactly will be disabled by it when it is beeing turned off? Will everthing be disabled so the statistics on the dashboard with the query number and ad's blocked number too?

Thanks you, 🙂 This project is awesome!

---

<div class="post-metadata">

**Author:** ![PromoFaux](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/promofaux/32/1545_2.png) [@PromoFaux](https://discourse.pi-hole.net/u/PromoFaux)\
**Post date:** [November 1, 2016, 4:20pm UTC](https://discourse.pi-hole.net/t/how-to-disable-logging/422/10 "2016-11-01T16:20:10Z")

</div>

The basic idea on the `logOnlogOff` branch is that it just toggles `query-logging` in `/etc/dnsmasq.d/01-pihole.conf` (You could do this manually, but the next update would reset it to default (on))

It's an all or nothing approach, and will literally log 0 queries!

---

<div class="post-metadata">

**Author:** ![anon30777135](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/a/ba9def/32.png) [@anon30777135](https://discourse.pi-hole.net/u/anon30777135)\
**Post date:** [November 1, 2016, 4:28pm UTC](https://discourse.pi-hole.net/t/how-to-disable-logging/422/11 "2016-11-01T16:28:30Z")

</div>

Oh okay, I understand. Thank you for that implanting it into the project. Do you have an ETA for a release yet? Can't wait to use it 😉

---

<div class="post-metadata">

**Author:** ![PromoFaux](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/promofaux/32/1545_2.png) [@PromoFaux](https://discourse.pi-hole.net/u/PromoFaux)\
**Post date:** [November 1, 2016, 4:30pm UTC](https://discourse.pi-hole.net/t/how-to-disable-logging/422/12 "2016-11-01T16:30:14Z")

</div>

Ugh! Don't use the `E` word!

It'll be ready when it's ready 🙂

---

<div class="post-metadata">

**Author:** ![anon30777135](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/a/ba9def/32.png) [@anon30777135](https://discourse.pi-hole.net/u/anon30777135)\
**Post date:** [November 1, 2016, 4:31pm UTC](https://discourse.pi-hole.net/t/how-to-disable-logging/422/13 "2016-11-01T16:31:36Z")

</div>

Oh okay, I am sorry for doing so. I was just getting so exited and wanted to try it 😃 So I used the E word...

---

<div class="post-metadata">

**Author:** ![PromoFaux](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/promofaux/32/1545_2.png) [@PromoFaux](https://discourse.pi-hole.net/u/PromoFaux)\
**Post date:** [November 1, 2016, 4:35pm UTC](https://discourse.pi-hole.net/t/how-to-disable-logging/422/14 "2016-11-01T16:35:03Z")

</div>

If you really want to try it out, try:

```auto
cd /etc/.pihole
sudo git fetch
sudo git checkout logOnlogOff (this may not work as the install only checks out master)
pihole -r (choose "reconfigure")

```

---

<div class="post-metadata">

**Author:** ![anon30777135](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/a/ba9def/32.png) [@anon30777135](https://discourse.pi-hole.net/u/anon30777135)\
**Post date:** [November 1, 2016, 4:41pm UTC](https://discourse.pi-hole.net/t/how-to-disable-logging/422/15 "2016-11-01T16:41:56Z")

</div>

Hi,  
I know get this error:  
`error: pathspec 'logOnlogOff' did not match any file(s) known to git.`

after entering git checkout logOnlogOff

---

<div class="post-metadata">

**Author:** ![PromoFaux](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/promofaux/32/1545_2.png) [@PromoFaux](https://discourse.pi-hole.net/u/PromoFaux)\
**Post date:** [November 1, 2016, 4:43pm UTC](https://discourse.pi-hole.net/t/how-to-disable-logging/422/16 "2016-11-01T16:43:51Z")

</div>

Yeah, thought that might happen.

```auto
sudo rm -rf /etc/.pihole
sudo git clone https://github.com/pi-hole/pi-hole.git
cd /etc/.pihole
sudo git fetch
sudo git checkout logOnlogOff
pihole -r (choose "reconfigure")

```

---

<div class="post-metadata">

**Author:** ![anon30777135](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/a/ba9def/32.png) [@anon30777135](https://discourse.pi-hole.net/u/anon30777135)\
**Post date:** [November 1, 2016, 4:56pm UTC](https://discourse.pi-hole.net/t/how-to-disable-logging/422/17 "2016-11-01T16:56:51Z")

</div>

Hi,  
Thank you that worked just fine 🙂 Now the only think I noticed after also running the -f command to clear the log file that the web interface needs some update too in order work with this non logging system. Maybe it could then just list current blacklisted domains. And a message that logging is off and that no statistic data can be collected.

---

<div class="post-metadata">

**Author:** ![Mcat12](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/mcat12/32/20_2.png) [@Mcat12](https://discourse.pi-hole.net/u/Mcat12)\
**Post date:** [November 1, 2016, 7:26pm UTC](https://discourse.pi-hole.net/t/how-to-disable-logging/422/18 "2016-11-01T19:26:14Z")

</div>

Yep. Before we get it actually released the web side will need some features added to accommodate it.

---

<div class="post-metadata">

**Author:** ![anon30777135](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/a/ba9def/32.png) [@anon30777135](https://discourse.pi-hole.net/u/anon30777135)\
**Post date:** [November 3, 2016, 8:01pm UTC](https://discourse.pi-hole.net/t/how-to-disable-logging/422/19 "2016-11-03T20:01:43Z")

</div>

I just saw that the logOnlogOff branch disappeared what happened to it? 😮

---

<div class="post-metadata">

**Author:** ![DanSchaper](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/danschaper/32/91_2.png) [@DanSchaper](https://discourse.pi-hole.net/u/DanSchaper)\
**Post date:** [November 3, 2016, 8:15pm UTC](https://discourse.pi-hole.net/t/how-to-disable-logging/422/20 "2016-11-03T20:15:06Z")

</div>

It's now integrated into the `development` branch and slated for release on the next version.
