coredns/plugin/debug
Miek Gieben f3134da45e
Clean up tests logging (#1979)
* Clean up tests logging

This cleans up the travis logs so you can see the failures better.

Older tests in tests/ would call log.SetOutput(ioutil.Discard) in
a haphazard way. This add log.Discard and put an `init` function in each
package's dir (no way to do this globally). The cleanup in tests/ is
clear.

All plugins also got this init function to have some uniformity and kill
any (future) logging there in the tests as well.

There is a one-off in pkg/healthcheck because that does log.

Signed-off-by: Miek Gieben <miek@miek.nl>

* bring back original log_test.go

Signed-off-by: Miek Gieben <miek@miek.nl>

* suppress logging here as well

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-19 16:23:06 +01:00
..
debug.go Remove the word middleware (#1067) 2017-09-14 09:36:06 +01:00
debug_test.go Update all plugins to use plugin/pkg/log (#1694) 2018-04-19 07:41:56 +01:00
log_test.go Clean up tests logging (#1979) 2018-07-19 16:23:06 +01:00
pcap.go Add debug.Hexdump (#1902) 2018-07-04 07:54:17 +01:00
pcap_test.go Add debug.Hexdump (#1902) 2018-07-04 07:54:17 +01:00
README.md Add debug.Hexdump (#1902) 2018-07-04 07:54:17 +01:00

debug

Name

debug - disables the automatic recovery upon a crash so that you'll get a nice stack trace.

Description

Normally CoreDNS will recover from panics, using debug inhibits this. The main use of debug is to help testing. A side effect of using debug is that log.Debug and log.Debugf will be printed to standard output.

Note that the errors plugin (if loaded) will also set a recover negating this setting.

Syntax

debug

Some plugin will debug log DNS messages. This is done in the following format:

debug: 000000 00 0a 01 00 00 01 00 00 00 00 00 01 07 65 78 61
debug: 000010 6d 70 6c 65 05 6c 6f 63 61 6c 00 00 01 00 01 00
debug: 000020 00 29 10 00 00 00 80 00 00 00
debug: 00002a

Using text2pcap (part of Wireshark) this can be converted back to binary, with the following command line: text2pcap -i 17 -u 53,53. Where 17 is the protocol (UDP) and 53 are the ports. These ports allow wireshark to detect these packets as DNS messages.

Each plugin can decide to dump messages to aid in debugging.

Examples

Disable the ability to recover from crashes and show debug logging:

. {
    debug
}

Also See

https://www.wireshark.org/docs/man-pages/text2pcap.html.