From fd0b41fd01d9c8d4a15fbee0a413e8731e1b0076 Mon Sep 17 00:00:00 2001 From: chaton78 Date: Wed, 13 Apr 2016 23:06:30 -0400 Subject: [PATCH] Better logging for MQTT consumer --- plugins/inputs/mqtt_consumer/mqtt_consumer.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/inputs/mqtt_consumer/mqtt_consumer.go b/plugins/inputs/mqtt_consumer/mqtt_consumer.go index 9cb420a42..beebe00ce 100644 --- a/plugins/inputs/mqtt_consumer/mqtt_consumer.go +++ b/plugins/inputs/mqtt_consumer/mqtt_consumer.go @@ -133,6 +133,7 @@ func (m *MQTTConsumer) Start(acc telegraf.Accumulator) error { return nil } func (m *MQTTConsumer) onConnect(c mqtt.Client) { + log.Printf("MQTT Client Connected") if !m.PersistentSession || !m.started { topics := make(map[string]byte) for _, topic := range m.Topics { @@ -150,7 +151,7 @@ func (m *MQTTConsumer) onConnect(c mqtt.Client) { } func (m *MQTTConsumer) onConnectionLost(c mqtt.Client, err error) { - log.Printf("MQTT Connection lost\nerror: %s\nClient should retry to reconnect", err.Error()) + log.Printf("MQTT Connection lost\nerror: %s\nMQTT Client will try to reconnect", err.Error()) return }