Bad request logging

Adding support to log the content of bad requests to the error log. This should make it easier to diagnose "Unable to parse request ..." errors.