Add HTTP/TLS Logging to NSURLLoading

Originator:heath.borders
Number:rdar://20291754 Date Originated:25-Mar-2015 09:53 AM
Status:Open Resolved:
Product:iOS SDK Product Version:iOS 8.2
Classification:Enhancement Reproducible:N/A
 
Summary:
NSURLLoading should support logging all HTTP Requests and Responses (including all cookies and authentication headers) as well as logging all TLS handshakes.

I've implemented a simplified HTTP Request/Response Logger [1] based on your CustomHTTPProtocol example [2]

[1] https://github.com/jivesoftware/JiveLoggingHTTPProtocol
[2] https://developer.apple.com/library/ios/samplecode/CustomHTTPProtocol/

Steps to Reproduce:
Add an NSURLSession object to enable logging to a delegate or to a file (in case a background request needs to be logged)

Expected Results:
For foreground requests, log object is created that consumers can log to a file or upload to a reporting system.
For background requests, the log is appended to the prescribed file


Actual Results:
The best we can do is to use something like https://github.com/jivesoftware/JiveLoggingHTTPProtocol

Version:
iOS 8.2

Notes:


Configuration:
iOS Simulator

Attachments:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!