Enable debug globally if enabled in any server config (#4007)
* Enable debug globally if enabled in any server config It was currently enabled only if the plugin debug was enabled in the last server config of the Corefile. Signed-off-by: Olivier Lemasle <o.lemasle@gmail.com> * Add test and update debug's README Signed-off-by: Olivier Lemasle <o.lemasle@gmail.com>
This commit is contained in:
parent
f6262eb2f6
commit
f36715e889
3 changed files with 36 additions and 4 deletions
|
@ -66,10 +66,6 @@ func NewServer(addr string, group []*Config) (*Server, error) {
|
|||
if site.Debug {
|
||||
s.debug = true
|
||||
log.D.Set()
|
||||
} else {
|
||||
// When reloading we need to explicitly disable debug logging if it is now disabled.
|
||||
s.debug = false
|
||||
log.D.Clear()
|
||||
}
|
||||
// set the config per zone
|
||||
s.zones[site.Zone] = site
|
||||
|
@ -97,6 +93,11 @@ func NewServer(addr string, group []*Config) (*Server, error) {
|
|||
site.pluginChain = stack
|
||||
}
|
||||
|
||||
if !s.debug {
|
||||
// When reloading we need to explicitly disable debug logging if it is now disabled.
|
||||
log.D.Clear()
|
||||
}
|
||||
|
||||
return s, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue