hello all
i have a log file the look like this
[DEBUG][DefaultHttpClient][2018-02-20 18:29:50,348] Attempt 1 to execute request
[DEBUG][DefaultClientConnection][2018-02-20 18:29:50,348] Sending request: POST /somepath HTTP/1.1
[DEBUG][wire][2018-02-20 18:29:50,349] >> "POST /somepath HTTP/1.1[\r][\n]"
[DEBUG][wire][2018-02-20 18:29:50,350] >> "Accept: */*[\r][\n]"
[DEBUG][wire][2018-02-20 18:29:50,350] >> "Content-Type: application/json; charset=UTF-8[\r][\n]"
[DEBUG][wire][2018-02-20 18:29:50,350] >> "Content-Length: 100[\r][\n]"
[DEBUG][wire][2018-02-20 18:29:50,350] >> "Host: some domain.com[\r][\n]"
[DEBUG][wire][2018-02-20 18:29:50,350] >> "Connection: Keep-Alive[\r][\n]"
[DEBUG][wire][2018-02-20 18:29:50,350] >> "Accept-Encoding: gzip,deflate[\r][\n]"
[DEBUG][wire][2018-02-20 18:29:50,350] >> "[\r][\n]"
[DEBUG][wire][2018-02-20 18:29:50,351] >> "{"some_key":"some_data_value"}"
[DEBUG][wire][2018-02-20 18:29:51,709] << "HTTP/1.1 200 OK[\r][\n]"
[DEBUG][wire][2018-02-20 18:29:51,713] << "Cache-Control: private, must-revalidate[\r][\n]"
[DEBUG][wire][2018-02-20 18:29:51,713] << "Cache-control: no-cache="set-cookie"[\r][\n]"
[DEBUG][wire][2018-02-20 18:29:51,713] << "Content-Type: application/json[\r][\n]"
[DEBUG][wire][2018-02-20 18:29:51,713] << "Date: Tue, 20 Feb 2018 16:29:51 GMT[\r][\n]"
[DEBUG][wire][2018-02-20 18:29:51,713] << "expires: 0[\r][\n]"
[DEBUG][wire][2018-02-20 18:29:51,714] << "pragma: no-cache[\r][\n]"
[DEBUG][wire][2018-02-20 18:29:51,714] << "Server: someserver/1.13.8[\r][\n]"
[DEBUG][wire][2018-02-20 18:29:51,714] << "Set-Cookie: thecookie=123adsdf.......[\r][\n]"
[DEBUG][wire][2018-02-20 18:29:51,714] << "Connection: keep-alive[\r][\n]"
[DEBUG][wire][2018-02-20 18:29:51,714] << "[\r][\n]"
[DEBUG][DefaultClientConnection][2018-02-20 18:29:51,715] Receiving response: HTTP/1.1 200 OK
[DEBUG][DefaultHttpClient][2018-02-20 18:29:51,721] Connection can be kept alive indefinitely
[DEBUG][RequestSpecificationImpl$RestAssuredHttpBuilder][2018-02-20 18:29:51,772] Parsing response
is it possible to log a single object for each request.
i was thinking something like this (or something similar just to separate the request and response headers) :
{
"message" :"...the original message",
"request_headers" : [{"key":"Accept", "value":"/somepath HTTP/1.1"}, {"key":"Content-Type:", "value":"application/json; charset=UTF-8"}, ..... and so on],
"response_headers": [{"key":"HTTP/1.1", "value":"200"}, {"key":"Cache-Control:", "value":"private, must-revalidate"}, ..... and so on],
"response_body": "i am the response body"
}
thank you