Add a function to log http requests