Log file for outgoing PHP requests (like access.log)

Is there a way to log all outgoing requests of PHP to a log file?

I’m not looking for a way to debug a single script with tcpdump but to continuously log all PHP requests, so I can review them later – i.e., very similar to the web servers access.log but for all outgoing requests that are made from any PHP script on the server.

I want to do two things with this:

  1. Confirm if my website is secure/GDPR-compliant and no scripts try to “phone home”.
  2. Our server is supposed to make one external request per day. I want to validate that those requests happen, and ideally also see the response code that was returned by the remote site.