log certName
alongside vpnIp
(#200)
This change adds a new helper, `(*HostInfo).logger()`, that starts a new logrus.Entry with `vpnIp` and `certName`. We don't use the helper inside of handshake_ix though since the certificate has not been attached to the HostInfo yet. Fixes: #84
This commit is contained in:
@ -182,7 +182,7 @@ func (n *connectionManager) HandleMonitorTick(now time.Time) {
|
||||
continue
|
||||
}
|
||||
|
||||
l.WithField("vpnIp", IntIp(vpnIP)).
|
||||
hostinfo.logger().
|
||||
WithField("tunnelCheck", m{"state": "testing", "method": "active"}).
|
||||
Debug("Tunnel status")
|
||||
|
||||
@ -191,7 +191,7 @@ func (n *connectionManager) HandleMonitorTick(now time.Time) {
|
||||
n.intf.SendMessageToVpnIp(test, testRequest, vpnIP, []byte(""), make([]byte, 12, 12), make([]byte, mtu))
|
||||
|
||||
} else {
|
||||
l.Debugf("Hostinfo sadness: %s", IntIp(vpnIP))
|
||||
hostinfo.logger().Debugf("Hostinfo sadness: %s", IntIp(vpnIP))
|
||||
}
|
||||
n.AddPendingDeletion(vpnIP)
|
||||
}
|
||||
@ -233,7 +233,7 @@ func (n *connectionManager) HandleDeletionTick(now time.Time) {
|
||||
if hostinfo.ConnectionState != nil && hostinfo.ConnectionState.peerCert != nil {
|
||||
cn = hostinfo.ConnectionState.peerCert.Details.Name
|
||||
}
|
||||
l.WithField("vpnIp", IntIp(vpnIP)).
|
||||
hostinfo.logger().
|
||||
WithField("tunnelCheck", m{"state": "dead", "method": "active"}).
|
||||
WithField("certName", cn).
|
||||
Info("Tunnel status")
|
||||
|
Reference in New Issue
Block a user