Skip to content

Commit d0a99cf

Browse files
stefliekensvrielsa
authored andcommitted
request uri and status code mapped with correct label in logging
1 parent c3fcda7 commit d0a99cf

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## [3.0.1] - 2021-05-21
4+
- Bugfix: request uri and status code mapped with correct label in logging
5+
36
## [3.0.0] - 2020-09-25
47

58
- Magento 2.4 compatibility

Plugin/RestApiLog.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ class RestApiLog
2424
public function __construct(
2525
LoggerInterface $logger,
2626
SystemConfiguration $configuration
27-
) {
27+
)
28+
{
2829
$this->logger = $logger;
2930
$this->configuration = $configuration;
3031
}
@@ -33,7 +34,8 @@ public function aroundDispatch(
3334
Rest $subject,
3435
callable $proceed,
3536
HttpRequest $request
36-
) {
37+
)
38+
{
3739
$time_pre = microtime(true);
3840
$response = $proceed($request);
3941
list($responseStatusCode, $responseBody) = $this->getResponseData($response);
@@ -42,8 +44,8 @@ public function aroundDispatch(
4244
'[API LOGGER] [IP: "%s"] [Method: "%s"] [Endpoint: "%s"] [ResponseCode: "%s"] [Exec Time: %s] [Request Body: "%s"] [Response Body: "%s"]',
4345
$request->getClientIp(),
4446
$request->getMethod(),
45-
$responseStatusCode,
4647
$request->getRequestUri(),
48+
$responseStatusCode,
4749
microtime(true) - $time_pre,
4850
$this->parseMessage($request->getContent()),
4951
$this->parseMessage($responseBody)

0 commit comments

Comments
 (0)