1

I have been using this package (https://github.com/maxbanton/cwh) to setup logging in my laravel 8 app. I can already send the logs properly and see them in Cloudwatch and what I am trying to do is to log the API calls (request and response). I was able to do this by doing it by adding it in the middleware. My only question is that how can you do this asynchronously? I have found this discussion posted as an issue and this was the suggested solution (https://github.com/maxbanton/cwh/issues/25#) but I couldn't figure out how to implement it.

Has anybody able to send API logs to Cloudwatch asynchronously? Thank you.

TheGPWorx
  • 857
  • 3
  • 17
  • 37

1 Answers1

0

What you can try is sent the call to a queued job or listener (beanstalkd preferably as using DB as storage will probably take the same time as sending the log to AWS) that is not running on the sync queue.

This way you can fire the call off to something else, and that can deal with it without you waiting for it.