From e1877d6761281cd6abb4db2e804d7838d262bcc6 Mon Sep 17 00:00:00 2001 From: Dirk Heilig Date: Mon, 23 Sep 2024 11:47:51 +0200 Subject: [PATCH] add more logs --- mqtt2prom/run | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mqtt2prom/run b/mqtt2prom/run index 43f3261..b2fb580 100755 --- a/mqtt2prom/run +++ b/mqtt2prom/run @@ -66,7 +66,6 @@ $mqtt->onMessage(function ($message) use ( &$isRunning, $mqttTopic ) { - logit("got message"); if ($mqttTopic . "/restart" === $message->topic) { $isRunning = false; return; @@ -86,6 +85,14 @@ $mqtt->onMessage(function ($message) use ( $payload["timestamp"] = time(); $data[] = $payload; $news = true; + logit( + "got message for " . + $payload["name"] . + ": " . + implode(", ", $payload["labels"]) . + " with value " . + $payload["value"] + ); }); logit("Subscribing to $mqttTopic with QoS $qos ");