Skip to content

Commit

Permalink
chore: more info log
Browse files Browse the repository at this point in the history
Signed-off-by: Rory Z <[email protected]>
  • Loading branch information
Rory-Z committed Nov 8, 2023
1 parent 54dc5ef commit cd1ae5f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions prober/mqtt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit cd1ae5f

Please sign in to comment.