mesosphere / mesos-dns

DNS-based service discovery for Mesos.
https://mesosphere.github.com/mesos-dns
Apache License 2.0
484 stars 137 forks source link

Dynamically change log level #350

Open sargun opened 8 years ago

sargun commented 8 years ago

Users would like to change the log level without interrupting service. Currently, they have to restart mesos-dns in order to do this.

I'd say as far as changing the loglevel - that can be dangerous. If someone accidentally raises the log level too high, and breaks things? If we're to do it, I think it would make sense to only allow changes from localhost.

As far as the API, looking at the config.go, if we wanted to have minimum effect we could expose each of the log levels a la:

PUT /debug/loglevel

payload: 0, 1, or 2

That aligns along the glog levels, and then we can set the flags as necessary. Part of me would prefer if we used a library like logrus, that has stronger control over these kinds of things, but we can think about that problem later.

jdef commented 8 years ago

Somewhat related, I had started on a PR to integrate support for dnstap into mesos-dns. It's a little crufty at this point (see #212) but the goal was to integrate support for wire level logging so that DNS problems could be traced very easily: user's wouldn't need root access for tcpdump and wouldn't have to share credentials for their VPN in order to get help troubleshooting. The goal would be that the user could start/stop capture of DNS messages on demand -- saving them to a file for later analysis.

While there is perhaps some value in changing log levels, I'm curious what the underlying customer need really is.

sargun commented 8 years ago

@jdef This isn't currently a customer requirement. I just wanted to break it out from #319. If we implement this, we'll implement it in "Mesos DNS 1.1" and not "1.0." The more important parts of that issue were related to metrics.