1

Hi I am using swift and Alamofire. Objective-C, we can log the AFNetworking activities through the AFNetworkActivityLogger.h.

Same as are their any way to do in Alamofire? Are their any Alamofire activity logger?

Lorenzo
  • 3,293
  • 4
  • 29
  • 56
Puvanarajan
  • 2,786
  • 6
  • 26
  • 37

2 Answers2

1

I don't think Alamofire supports this feature. You should write yourself a logger, have a look at this How can I log each request/response using Alamofire?

Community
  • 1
  • 1
r4id4
  • 5,877
  • 8
  • 46
  • 76
1

There's a pod that can help you with that AlamofireLogbook

https://github.com/mikeAttia/AlamofireLogbook

You can conform to AlamofireResponseListener which sends you the a LogItem with all the request and the response data that you can log in the debugger or to your own log.

And it also have a neat view that shows a searchable list of all the Alamofire calls, its result and the server response, which you can also share from the device.

You can find screenshots of that logger view on the pod github page

full disclaimer: I am the author of this pod

Mike
  • 13
  • 3