Add logging of 500 errors