AdguardTeam / dnsproxy

Simple DNS proxy with DoH, DoT, DoQ and DNSCrypt support
Apache License 2.0
2.37k stars 246 forks source link

Please log upstreams on start #200

Open timkgh opened 2 years ago

timkgh commented 2 years ago

It currently logs the fallback, but it would be useful to log the upstreams also to make sure the config is correct: 2022/01/11 13:59:18 [info] Fallback 0 is https://1.1.1.2:443/dns-query Similar lines should be logged for upstreams.

Maybe more useful config options should also be logged, in particular when reading from the yaml config file, i'm not confident all of them are interpreted correctly.

gspannu commented 2 years ago

Logging should include all config options, so that later debugging is useful.

schzhn commented 7 months ago

@timkgh, you can enable verbose log output by using the -v flag.

./dnsproxy -v -l 127.0.0.1 -p 5353 -u 9.9.9.9 -u 2620:fe::fe -f 149.112.112.112 -f 2620:fe::9
[info] Starting dnsproxy 0
[debug] dnsproxy: upstream at index 0: 9.9.9.9:53
[debug] dnsproxy: upstream at index 1: [2620:fe::fe]:53
[debug] dnsproxy: upstream at index 0: 149.112.112.112:53
[debug] dnsproxy: upstream at index 1: [2620:fe::9]:53
ainar-g commented 7 months ago

@schzhn, that output does not include the section, so this issue should remain open at least until we do that.

iJorgen commented 7 months ago

It currently logs the fallback, but it would be useful to log the upstreams also to make sure the config is correct: 2022/01/11 13:59:18 [info] Fallback 0 is https://1.1.1.2:443/dns-query Similar lines should be logged for upstreams.

You can fix this is you self-compile. Change this line from "log.Debug" to "log.Info". https://github.com/AdguardTeam/dnsproxy/blob/64814cc1ef71e45d6f0c8a45e38f9babe04d250e/proxy/upstreams.go#L266

timkgh commented 7 months ago

you can enable verbose log output by using the -v flag

@schzhn I do not want to run with verbose logging all the time, just want to see useful config info at start.