title: Log all cURL requests from an PHP application with third-party libraries
body: <p>Alright, I'm having a tough time in my PHP Yii2 application. I need to log every incoming and outgoing requests from my application. Incomming requests can be easily logged in PHP itself (adding some handler in bootstrap stage), that is easy.</p>
  
  <p>But the real problem is I'm using many third-party libraries (i.e. Amazon MWS SDK, Ebay SDK, some Guzzle requests, etc) and I want to log all outgoing requests with error response (for debug/analyze reasons).</p>
  
  <p>Is it even possible to change some settings in curl, to log those requests? I mean does curl support some settings in <code>php.ini</code> <code>[curl]</code> for logging stuff.. Or if not, is there sources for <code>php_curl.dll</code> that you can make some changes to write logs, and compile it.. Or at least add some handler for all curl request in application without changing/copying the third-party SDKs.</p>
  
  <p>I've searched for this issue, and found a solution like <code>tcpdump</code> or wireshark to sniff some packets, but is there really no solution in <code>curl</code> side to implement a logging?</p>
  
  <p>Thanks for your attention</p>