Skip to content
Snippets Groups Projects
Commit 281054df authored by Markus Guenther's avatar Markus Guenther
Browse files

[BUGFIX] Fix log parameters and also log the raw POST data

parent b36f2d45
No related branches found
No related tags found
No related merge requests found
......@@ -172,7 +172,8 @@ class Dispatcher {
$this->logRequest(
'The DELETE method is not permitted for the given path.',
[
'httpMethod' => $identifier,
'httpMethod' => $httpMethod,
'identifier' => $identifier,
'apiKey' => $apiKey,
'requestSegments' => $this->requestSegments,
'requestHeaders' => $this->requestHeaders,
......@@ -192,7 +193,8 @@ class Dispatcher {
$this->logRequest(
'The ' . $httpMethod . ' method is not permitted for the given path.',
[
'httpMethod' => $identifier,
'httpMethod' => $httpMethod,
'identifier' => $identifier,
'apiKey' => $apiKey,
'requestSegments' => $this->requestSegments,
'requestHeaders' => $this->requestHeaders,
......@@ -212,7 +214,8 @@ class Dispatcher {
$this->logRequest(
'The requested path does not exist.',
[
'httpMethod' => $identifier,
'httpMethod' => $httpMethod,
'identifier' => $identifier,
'apiKey' => $apiKey,
'requestSegments' => $this->requestSegments,
'requestHeaders' => $this->requestHeaders,
......@@ -228,7 +231,8 @@ class Dispatcher {
$this->logRequest(
'The requested path does not exist.',
[
'httpMethod' => $identifier,
'httpMethod' => $httpMethod,
'identifier' => $identifier,
'apiKey' => $apiKey,
'requestSegments' => $this->requestSegments,
'requestHeaders' => $this->requestHeaders,
......@@ -267,7 +271,8 @@ class Dispatcher {
$this->logRequest(
'REST Request before runControllerAction: ',
[
'httpMethod' => $identifier,
'httpMethod' => $httpMethod,
'identifier' => $identifier,
'parameters' => $parameters,
'apiKey' => $apiKey,
'requestSegments' => $this->requestSegments,
......@@ -294,6 +299,18 @@ class Dispatcher {
if (in_array($this->getMethod(), ['PUT', 'POST', 'PATCH'])) {
$jsonInput = file_get_contents('php://input');
$this->logRequest(
'REST Request: get request parameters before JSON decode',
[
'requestSegments' => $this->requestSegments,
'requestHeaders' => $this->requestHeaders,
'input' => $jsonInput,
'POST' => $_POST
],
LogLevel::INFO
);
$parameters = json_decode($jsonInput, TRUE);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment