From 4b83474f2af7ced51c856accaebd3acaaf522df6 Mon Sep 17 00:00:00 2001 From: Michael Rauter Date: Wed, 21 Feb 2018 16:12:07 +0100 Subject: [PATCH] Fix for kafka logger (#6430) * 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 --- CHANGELOG.asciidoc | 1 + libbeat/outputs/kafka/log.go | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index fdf7d3f6ef10..b6e994d8760b 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -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* diff --git a/libbeat/outputs/kafka/log.go b/libbeat/outputs/kafka/log.go index 673ee956eac2..8ab83c6dd219 100644 --- a/libbeat/outputs/kafka/log.go +++ b/libbeat/outputs/kafka/log.go @@ -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{}) { @@ -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...) } }