added error log for the submission of sensor data

This commit is contained in:
dorian 2019-08-08 15:24:19 +02:00
parent 7392f66e11
commit db8b1f3074

View file

@ -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);