}
}
public void logJson(RestResponse response, long contentLength, long now) {
long latency = now - timestamp;
DateTime nowdt = new DateTime(now);
DateTime startdt = new DateTime(timestamp);
try {
XContentBuilder json = XContentFactory.jsonBuilder().startObject();
json.field("time", nowdt.toDateTimeISO().toString());
json.field("starttime", startdt.toDateTimeISO().toString());
json.field("localaddr", localaddr);
json.field("localport", localport);
json.field("remoteaddr", remoteaddr);
json.field("remoteport", remoteport);
json.field("scheme", scheme);