mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-27 19:59:58 +00:00
TUN-3471: Add structured log context to logs
This commit is contained in:

committed by
Arég Harutyunyan

parent
abab78730d
commit
55bf904689
@@ -63,13 +63,18 @@ func (e muxerShutdownError) Error() string {
|
||||
}
|
||||
|
||||
func isHandshakeErrRecoverable(err error, connIndex uint8, observer *Observer) bool {
|
||||
log := observer.log.With().
|
||||
Uint8(LogFieldConnIndex, connIndex).
|
||||
Err(err).
|
||||
Logger()
|
||||
|
||||
switch err.(type) {
|
||||
case edgediscovery.DialError:
|
||||
observer.log.Error().Msgf("Connection %d unable to dial edge: %s", connIndex, err)
|
||||
log.Error().Msg("Connection unable to dial edge")
|
||||
case h2mux.MuxerHandshakeError:
|
||||
observer.log.Error().Msgf("Connection %d handshake with edge server failed: %s", connIndex, err)
|
||||
log.Error().Msg("Connection handshake with edge server failed")
|
||||
default:
|
||||
observer.log.Error().Msgf("Connection %d failed: %s", connIndex, err)
|
||||
log.Error().Msg("Connection failed")
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
Reference in New Issue
Block a user