Skip to content

Commit

Permalink
Merge pull request moby#47417 from thaJeztah/resolver_improve_logs
Browse files Browse the repository at this point in the history
libnetwork: resolve: use structured logs for DNS error
  • Loading branch information
thaJeztah authored Feb 21, 2024
2 parents 9d15415 + d9e082f commit c42ae61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libnetwork/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ func (r *Resolver) exchange(ctx context.Context, proto string, extDNS extDNSEntr
UDPSize: dns.MaxMsgSize,
}).ExchangeWithConn(query, &dns.Conn{Conn: extConn})
if err != nil {
r.log(ctx).WithError(err).Errorf("[resolver] failed to query DNS server: %s, query: %s", extConn.RemoteAddr().String(), query.Question[0].String())
logger.WithError(err).Error("[resolver] failed to query external DNS server")
span.RecordError(err)
span.SetStatus(codes.Error, "ExchangeWithConn failed")
return nil
Expand Down

0 comments on commit c42ae61

Please sign in to comment.