added error log for the submission of sensor data
This commit is contained in:
parent
7392f66e11
commit
db8b1f3074
1 changed files with 6 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue