final Throwable thrown = record.getThrown();
if (thrown != null) {
json.writeStartObject(JSON_KEY_EXCEPTION);
boolean withDescription = true;
writeThrowableToJson(json, thrown, withDescription);
json.writeEnd();
}
final Map<String, String> context = thrown != null ?
LoggingContext.getLastEnteredContext() :
LoggingContext.getContext();