From 93f57edd3af607da2eae0da2edad460cfab04261 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 closes #1023 closes #921 --- CHANGELOG.md | 3 ++- plugins/inputs/mqtt_consumer/mqtt_consumer.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1fd5ed4..cd5ea062 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ### Release Notes - `tagexclude` and `tagexclude` are now available, which can be used to remove -tags from measurements on inputs and outputs. See +tags from measurements on inputs and outputs. See [the configuration doc](https://github.com/influxdata/telegraf/blob/master/docs/CONFIGURATION.md) for more details. - **Measurement filtering:** All measurement filters now match based on glob @@ -14,6 +14,7 @@ based on _prefix_ in addition to globs. This means that a filter like - [#1017](https://github.com/influxdata/telegraf/pull/1017): taginclude and tagexclude arguments. ### Bugfixes +- [#921](https://github.com/influxdata/telegraf/pull/921): mqtt_consumer stops gathering metrics. Thanks @chaton78! ## v0.12.1 [2016-04-14] diff --git a/plugins/inputs/mqtt_consumer/mqtt_consumer.go b/plugins/inputs/mqtt_consumer/mqtt_consumer.go index 9cb420a4..beebe00c 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 }