Skip to content

Commit

Permalink
Pull request 278: Log upstream error
Browse files Browse the repository at this point in the history
Merge in GO/dnsproxy from log-upstream-error to master

Squashed commit of the following:

commit 6031dda
Author: Andrey Meshkov <am@adguard.com>
Date:   Mon Aug 14 22:55:05 2023 +0300

    proxy: log upstream exchange errors with error level
  • Loading branch information
ameshkov committed Aug 16, 2023
1 parent 6c91fb2 commit d1469a4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion proxy/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func exchangeWithUpstream(u upstream.Upstream, req *dns.Msg) (*dns.Msg, int, err
reply, err := u.Exchange(req)
elapsed := time.Since(startTime)
if err != nil {
log.Tracef(
log.Error(
"upstream %s failed to exchange %s in %s. Cause: %s",
u.Address(),
req.Question[0].String(),
Expand All @@ -84,6 +84,7 @@ func exchangeWithUpstream(u upstream.Upstream, req *dns.Msg) (*dns.Msg, int, err
elapsed,
)
}

return reply, int(elapsed.Milliseconds()), err
}

Expand Down

0 comments on commit d1469a4

Please sign in to comment.