Feature #4311

Make http logging more verbose and exterenally customizable

Added by Stavros Sachtouris almost 11 years ago. Updated almost 11 years ago.

Status:Closed Start date:09/16/2013
Priority:Medium Due date:09/16/2013
Assignee:Stavros Sachtouris % Done:

100%

Category:- Spent time: 3.00 hours
Target version:- Estimated time:2.00 hours

Description

Before: http logging was of the form "Perform a GET request to <url> with ... headers and ... body", with a lot of omissions, especially in response.

Suggested:

GET <url>
<header>: <header value>
... (all headers - with token being hashed)
data size: 42

< 200 OK
< <header>: <header value>
< ...
< data size: 0

Also, move the control of log_body (flag to specify if the http request/response data are logged) from _call_astakos method to the constructor.
This will allow external software to handle whether they want data to be logged or not.

Please, do this in a way that does not disturb current astakosclient functionality.


Related issues

blocks ./kamaki - Feature #4312: Make astakosclient an intergral part of kamaki Closed 09/16/2013 09/20/2013

Associated revisions

Revision 84664e2f
Added by Stavros Sachtouris almost 11 years ago

Replace http log message with more verbose ones

Refs: #4311

Old log messages were of the form "Perform a GET request at ... with ..."
Now, the messages are of the form:

GET <url>
<header>: <header value>
...
data size: 42

< 200 OK
< <header>: <header value>
< ...
< data size: 0

Note: the > and < symbols refer to Request and Response respectively and are
inspired by kamaki logs

Revision bfdcbcf5
Added by Stavros Sachtouris almost 11 years ago

Move log_body flag from _call_astakos to init

Refs: #4311

log_body becomes (a) a init param defaulting to True and (b) a member variable

_call_astakos looses log_body as a param.

Revision 6c10f589
Added by Stavros Sachtouris almost 11 years ago

Move flag log_body from _call_astakos to init

Refs: #4311

Explanation: log_body en/disables http data logging.

Make it a member var + init argument, to allow callers to customize it
Defaults to True

Warning: method _get_endpoints forces this to False for security reasons
Changes have been applied to recover self.log_body in that case
Also, this method should be avoided

History

#1 Updated by Stavros Sachtouris almost 11 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

#2 Updated by Stavros Sachtouris almost 11 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF