Wrap logging in the request
Move logging to separate file