Logging json response in a log file

We can log console output in a logger file using library like logger backend, but is it possible to also log the server json response inside some file. Maybe set a plug that will log the response before sending it to the front end because logging in each individual place is really not that desireable. I am just thinking about how to do this in an optimal way.

Any suggestions would be much appreciated.
Thank you :slight_smile: