Added api request debugging

This commit is contained in:
Frank Schubert
2022-09-16 13:18:24 +02:00
parent 7a867cbc5e
commit 7462f4219a

View File

@@ -31,8 +31,25 @@ class mfBaseApicontroller {
public function __construct($params = NULL) {
// load logging facility
$this->log = mfLoghandler::singleton();
$this->log->debug("new API request for ".$_SERVER['REQUEST_URI']);
$logstr = "";
foreach($_GET as $key => $value) {
$logstr .= "; $key='$value'";
}
$this->log->debug("GET: ".print_r($_GET, true));
$logstr = "";
foreach($_POST as $key => $value) {
$logstr .= "; $key='$value'";
}
$this->log->debug("POST: ".print_r($_POST, true));
$this->loadRequest($params);
$this->log->debug("POST JSON: ".$this->request_json);
$this->log->debug("HEADERS: ".print_r($this->headers, true));
register_shutdown_function(["mfBaseApicontroller", "return_errors"]);
// run Controllers init() function