not-nexus / shelf

REST API for AWS S3 meant to be an interface to immutable artifact storage.
MIT License
8 stars 3 forks source link

Logging method and status code #101

Closed quantumew closed 7 years ago

codecov-io commented 7 years ago

Codecov Report

Merging #101 into master will not change coverage.

@@          Coverage Diff          @@
##           master   #101   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          72     72           
  Lines        1985   1991    +6     
=====================================
+ Hits         1985   1991    +6
Impacted Files Coverage Δ
shelf/request_log_filter.py 100% <100%> (ø) :white_check_mark:
shelf/endpoint_decorators.py 100% <100%> (ø) :white_check_mark:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update bafee76...58e8b55. Read the comment docs.

kyle-long commented 7 years ago

I think it would be cool to do something like

my_list = [
    response.status_code
]

for key, value in response.headers.iteritems():
    my_list.append("{0}: {1}".format(key, value))

logger.info("\n".join(my_list))    

Also, could you instead make the verb part of the main logging format string and add stuff to the RequestLogFilter for it?

quantumew commented 7 years ago

@kyle-long Good idea. hopefully this is close enough 58e8b5571ab52f364e5eeeab436c89a78bf974a9 - The log headers is used by request and response headers so I just made that function redact it instead.