Closed
Description
Hi.
First of all I'd like to say thank you for this library it is really helpful.
It would be nice to improve getContent
method and return request/response as an array instead of string. As currently getContent
returns json encodable string. For example:
{
"message": "Response content: \"200 https://fake.api.com\"",
"context": {
"request": "{\"property\":\"99544\"}",
"response": "{\"id\":\"13793060365814579204730000\"}",
"info": {}
},
"level": 200,
"level_name": "INFO",
"channel": "http",
"datetime": "2025-05-16T10:03:31.444186+00:00",
"extra": {}
}
As developer I'd like to see array as it's better from readability point of view. Like:
{
"message": "Response content: \"200 https://fake.api.com\"",
"context": {
"request": [
"property" => "99544",
... additional properties
]",
"response": [
"id" => "13793060365814579204730000",
... additional properies
],
"info": {}
},
"level": 200,
"level_name": "INFO",
"channel": "http",
"datetime": "2025-05-16T10:03:31.444186+00:00",
"extra": {}
}
p.s. so it would be identical what guzzle middleware does. For reference: https://github.com/gmponos/guzzle-log-middleware/blob/master/src/Handler/MultiRecordArrayHandler.php#L143-L148