Restructure request and response logging