public void logResponse(Config config, HttpRequest request, Response response) {
        long startTime = request.getStartTime();
        long elapsedTime = request.getEndTime() - startTime;
        response.setResponseTime(elapsedTime);
        StringBuilder sb = new StringBuilder();
        String uri = request.getUrl();
        HttpLogModifier responseModifier = logModifier(config, uri);
        sb.append("response time in milliseconds: ").append(elapsedTime).append('\n');
        sb.append(requestCount).append(" < ").append(response.getStatus());
        logHeaders(requestCount, " < ", sb, responseModifier, response.getHeaders());
        ResourceType rt = response.getResourceType();
        if (rt == null || rt.isBinary()) {
            // don't log body
        } else {
            logBody(config, responseModifier, sb, uri, response.getBody(), false, rt);
        }
        sb.append('\n');
        logger.debug("{}", sb);
    }
@Test
    void testResponseLoggingJson() {
        setup("json", "{a: 1}", "application/json");
        httpRequestBuilder.path("/json");
        Response response = handle();
        match(response.getBodyAsString(), "{a: 1}");
        match(response.getContentType(), "application/json");

        httpLogger.logResponse(config, request, response);
        String logs = logAppender.collect();
        assertTrue(logs.contains("{a: 1}"));
        assertTrue(logs.contains("Content-Type: application/json"));
    }