Log and swallow exception while getting content length