From baafedbf88acd667d12a57e0254ea23910723698 Mon Sep 17 00:00:00 2001 From: Dirk Heilig Date: Mon, 23 Sep 2024 11:50:08 +0200 Subject: [PATCH] add more logs --- mqtt2prom/run | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mqtt2prom/run b/mqtt2prom/run index b2fb580..d5a0c6e 100755 --- a/mqtt2prom/run +++ b/mqtt2prom/run @@ -85,13 +85,17 @@ $mqtt->onMessage(function ($message) use ( $payload["timestamp"] = time(); $data[] = $payload; $news = true; + $v = []; + foreach ($$payload["labels"] as $key => $value) { + $v[] = $key . "=" . $value; + } logit( "got message for " . $payload["name"] . ": " . implode(", ", $payload["labels"]) . " with value " . - $payload["value"] + implode(", ", $v) ); });