Skip to content

Commit 1111a9e

Browse files
authored
[transport] make dial error logging compatible with ECS (#227)
The LoggingDiler was logging an error with the field 'network' set as the network type (tcp/upd), however 'network' is an object in ECS, this would cause the log entry to be rejected by Elasticsearch.
1 parent 999dd7a commit 1111a9e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

transport/logging.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type loggingConn struct {
3333

3434
func LoggingDialer(d Dialer, logger *logp.Logger) Dialer {
3535
return DialerFunc(func(ctx context.Context, network, addr string) (net.Conn, error) {
36-
logger := logger.With("network", network, "address", addr)
36+
logger := logger.With("network.transport", network, "server.address", addr)
3737
c, err := d.DialContext(ctx, network, addr)
3838
if err != nil {
3939
logger.Errorf("Error dialing %v", err)

0 commit comments

Comments
 (0)