From cd1ae5fb0ea08e357d388e7bd865a566fe7d0dbf Mon Sep 17 00:00:00 2001 From: Rory Z <16801068+Rory-Z@users.noreply.github.com> Date: Wed, 8 Nov 2023 11:10:46 +0800 Subject: [PATCH] chore: more info log Signed-off-by: Rory Z <16801068+Rory-Z@users.noreply.github.com> --- prober/mqtt.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prober/mqtt.go b/prober/mqtt.go index c5a5f52..ec1ea27 100644 --- a/prober/mqtt.go +++ b/prober/mqtt.go @@ -58,10 +58,10 @@ func initMQTTProbe(probe config.Probe, logger log.Logger) (*MQTTProbe, error) { opt.SetTLSConfig(probe.TLSClientConfig.ToTLSConfig()) } opt.SetOnConnectHandler(func(c mqtt.Client) { - level.Info(logger).Log("msg", "Connected to MQTT broker") + level.Info(logger).Log("msg", "Connected to MQTT broker", "target", probe.Target) }) opt.SetConnectionLostHandler(func(c mqtt.Client, err error) { - level.Error(logger).Log("msg", "Lost connection to MQTT broker", "err", err) + level.Error(logger).Log("msg", "Lost connection to MQTT broker", "target", probe.Target, "err", err) }) c := mqtt.NewClient(opt) if token := c.Connect(); token.Wait() && token.Error() != nil {