(NC-194) Log exceptions caught by middleware

Log exceptions caught in middleware at the WARN level. This adds a small
helper function that also logs the request method and URI.