Commit a9adfd56 authored by Ondřej Benkovský's avatar Ondřej Benkovský Committed by GitHub

Log panic cause for better debugging (#5091)

parent 1c4e8eb7
...@@ -213,7 +213,7 @@ func (s *Server) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) ...@@ -213,7 +213,7 @@ func (s *Server) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
// In case the user doesn't enable error plugin, we still // In case the user doesn't enable error plugin, we still
// need to make sure that we stay alive up here // need to make sure that we stay alive up here
if rec := recover(); rec != nil { if rec := recover(); rec != nil {
log.Errorf("Recovered from panic in server: %q", s.Addr) log.Errorf("Recovered from panic in server: %q %v", s.Addr, rec)
vars.Panic.Inc() vars.Panic.Inc()
errorAndMetricsFunc(s.Addr, w, r, dns.RcodeServerFailure) errorAndMetricsFunc(s.Addr, w, r, dns.RcodeServerFailure)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment