summaryrefslogtreecommitdiffhomepage
path: root/server/peer.go
diff options
context:
space:
mode:
Diffstat (limited to 'server/peer.go')
-rw-r--r--server/peer.go13
1 files changed, 10 insertions, 3 deletions
diff --git a/server/peer.go b/server/peer.go
index 08a52530..ee3b2311 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -96,8 +96,11 @@ func NewPeer(g config.GlobalType, peer config.NeighborType, serverMsgCh chan *se
}
func (peer *Peer) handleBGPmessage(m *bgp.BGPMessage) {
- j, _ := json.Marshal(m)
- log.Debugf("received %v: %s", peer.peerConfig.NeighborAddress, j)
+ log.WithFields(log.Fields{
+ "Topic": "Peer",
+ "Key": peer.peerConfig.NeighborAddress,
+ "data": m,
+ }).Debug("received")
switch m.Header.Type {
case bgp.BGP_MSG_OPEN:
@@ -151,7 +154,11 @@ func (peer *Peer) sendMessages(msgs []*bgp.BGPMessage) {
_, y := peer.capMap[bgp.BGP_CAP_FOUR_OCTET_AS_NUMBER]
if !y {
- log.Debug("update BGPUpdate for 2byte AS peer, ", peer.peerConfig.NeighborAddress.String())
+ log.WithFields(log.Fields{
+ "Topic": "Peer",
+ "Key": peer.peerConfig.NeighborAddress,
+ "data": m,
+ }).Debug("update for 2byte AS peer")
table.UpdatePathAttrs2ByteAs(m.Body.(*bgp.BGPUpdate))
}