CodeIgniter Forums
Architecture for Logging RESTful Requests/Responses - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Architecture for Logging RESTful Requests/Responses (/showthread.php?tid=88650)



Architecture for Logging RESTful Requests/Responses - mikestratton - 10-11-2023

Does anyone have recommendations for solid architecture that would allow me to log all controller HTTP Requests/Responses?


RE: Architecture for Logging RESTful Requests/Responses - CIDave - 10-11-2023

Hi,

Create a Filter to log all requests.

See https://codeigniter4.github.io/userguide/incoming/filters.html

You can use log_message() function to write to log file or use the DB whatever you want.


RE: Architecture for Logging RESTful Requests/Responses - Asuka - 10-13-2023

Thanks for sharing, I'll come back to you if I encounter a problem.