From db8b1f30744edd8f9cc5205ad94fb699cfe670d8 Mon Sep 17 00:00:00 2001 From: dorian Date: Thu, 8 Aug 2019 15:24:19 +0200 Subject: [PATCH] added error log for the submission of sensor data --- api/json.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/json.php b/api/json.php index 1befe5d..796b025 100755 --- a/api/json.php +++ b/api/json.php @@ -37,6 +37,12 @@ if (isset($_GET['locId'])) { $sensorData = json_decode($_POST['submitSensorData'], true); $ret = $blueweather->processSensorData($sensorData); $data = $ret; + if ($ret['status'] !== 200) { + $log = "\n[".date("M,d,Y h:i:s A")."] ret: ".json_encode($ret)." request: ".json_encode($_POST['submitSensorData']); + //echo $log; + file_put_contents("./error.log" ,$log, FILE_APPEND); + } + } elseif (isset($_GET['command'])) { // some user-data api request $request = json_decode($_GET['command'], true);