Added function to log request details.