Skip to content

Commit

Permalink
Fix for kafka logger (#6430)
Browse files Browse the repository at this point in the history
* Fix for kafka logger

The arguments are passed as slice (v) instead of a argument list (v...) which results in a wrong output in the log

* Add pull request to CHANGELOG
  • Loading branch information
mrauter authored and Steffen Siering committed Feb 21, 2018
1 parent 5bdfd9b commit 4b83474
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ https://github.com/elastic/beats/compare/v6.0.0-beta2...master[Check the HEAD di
- Fix `setup.dashboards.always_kibana` when using Kibana 5.6. {issue}6090[6090]
- Update Golang 1.9.4 {pull}6326[6326]
- Fix conditions checking on autodiscover Docker labels. {pull}6412[6412]
- Fix for kafka logger. {pull}6430[6430]

*Auditbeat*

Expand Down
8 changes: 4 additions & 4 deletions libbeat/outputs/kafka/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
type kafkaLogger struct{}

func (kl kafkaLogger) Print(v ...interface{}) {
kl.Log("kafka message: %v", v)
kl.Log("kafka message: %v", v...)
}

func (kl kafkaLogger) Printf(format string, v ...interface{}) {
kl.Log(format, v)
kl.Log(format, v...)
}

func (kl kafkaLogger) Println(v ...interface{}) {
Expand All @@ -31,8 +31,8 @@ func (kafkaLogger) Log(format string, v ...interface{}) {
}
}
if warn {
logp.Warn(format, v)
logp.Warn(format, v...)
} else {
logp.Info(format, v)
logp.Info(format, v...)
}
}

0 comments on commit 4b83474

Please sign in to comment.