Skip to content

Commit

Permalink
Merge pull request moby#2088 from fcrisciani/transient-log
Browse files Browse the repository at this point in the history
Limit max length transient log
  • Loading branch information
Flavio Crisciani authored Feb 26, 2018
2 parents 9cdb30e + 885a042 commit a2e6eb2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions service_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"github.com/sirupsen/logrus"
)

const maxSetStringLen = 350

func (c *controller) addEndpointNameResolution(svcName, svcID, nID, eID, containerName string, vip net.IP, serviceAliases, taskAliases []string, ip net.IP, addService bool, method string) error {
n, err := c.NetworkByID(nID)
if err != nil {
Expand Down Expand Up @@ -285,7 +287,7 @@ func (c *controller) addServiceBinding(svcName, svcID, nID, eID, containerName s
ok, entries := s.assignIPToEndpoint(ip.String(), eID)
if !ok || entries > 1 {
setStr, b := s.printIPToEndpoint(ip.String())
logrus.Warnf("addServiceBinding %s possible trainsient state ok:%t entries:%d set:%t %s", eID, ok, entries, b, setStr)
logrus.Warnf("addServiceBinding %s possible transient state ok:%t entries:%d set:%t %s", eID, ok, entries, b, setStr[:maxSetStringLen])
}

// Add loadbalancer service and backend in all sandboxes in
Expand Down Expand Up @@ -353,7 +355,7 @@ func (c *controller) rmServiceBinding(svcName, svcID, nID, eID, containerName st
ok, entries := s.removeIPToEndpoint(ip.String(), eID)
if !ok || entries > 0 {
setStr, b := s.printIPToEndpoint(ip.String())
logrus.Warnf("rmServiceBinding %s possible trainsient state ok:%t entries:%d set:%t %s", eID, ok, entries, b, setStr)
logrus.Warnf("rmServiceBinding %s possible transient state ok:%t entries:%d set:%t %s", eID, ok, entries, b, setStr[:maxSetStringLen])
}

// Remove loadbalancer service(if needed) and backend in all
Expand Down

0 comments on commit a2e6eb2

Please sign in to comment.