Dockbeat logging
Closed this issue · 0 comments
Hey there,
Dockbeat Version
ingensi/dockbeat:latest / 806a70b
Bug
The formatting of Dockbeat outputs lines like the following
2016/11/10 18:30:22.579066 dockbeat.go:320: INFO dockbeat%!(EXTRA string=Publishing %v events, int=5)
This is caused by lines like logp.Info("dockbeat", "Publishing %v events", len(events))
found at https://github.com/Ingensi/dockbeat/blob/develop/beater/dockbeat.go#L320 . Logp uses fmt.Sprintf internally to format the strings you give it. The first string is the prefix and all strings after are used to format. To see the internals of Logp see https://github.com/elastic/libbeat/blob/master/logp/log.go#L54
Proposal
Modify all invocations of logp functions to use the proper format so instead of the above log line, the following is outputted. 2016/11/10 18:30:22.579066 dockbeat.go:320: INFO dockbeat Publishing 5 events
Extra
I wanted to ensure this was a bug before submitting a PR to fix.