Flatten exception details in API and controller logs

Merged Stan Hu requested to merge sh-flatten-json-exceptions into master

Elasticsearch and Fluentd don't handle nested objects well: the exception field is currently parsed as a string and can't be searched with the specific keywords. As we do with Gitaly logs, flatten the fields to exception.class, exception.message, and exception.backtrace to enable better searchability.

Edited by Stan Hu