private static Function<RequestLog, Object> findResolver(String variable) {
            // The same order as methods in the RequestLog interface.
            switch (variable) {
                case "method":
                    return log -> log.requestHeaders().method();
                case "path":
                    return log -> log.context().path();
                case "query":
                    return log -> log.context().query();

                case "requestStartTimeMillis":
                    return RequestLog::requestStartTimeMillis;
                case "requestEndTimeMillis":
                    return log -> Instant.ofEpochMilli(log.requestStartTimeMillis())
                                         .plusNanos(log.requestDurationNanos()).toEpochMilli();
                case "requestDurationMillis":
                    return log -> Duration.ofNanos(log.requestDurationNanos()).toMillis();
                case "requestDurationNanos":
                    return RequestLog::requestDurationNanos;
                case "requestLength":
                    return RequestLog::requestLength;
                case "requestCause":
                    return log -> handleThrowable(log.requestCause());
                case "requestContentPreview":
                    return RequestLog::requestContentPreview;

                case "responseStartTimeMillis":
                    return RequestLog::responseStartTimeMillis;
                case "responseEndTimeMillis":
                    return log -> Instant.ofEpochMilli(log.responseStartTimeMillis())
                                         .plusNanos(log.responseDurationNanos()).toEpochMilli();
                case "responseDurationMillis":
                    return log -> Duration.ofNanos(log.responseDurationNanos()).toMillis();
                case "responseDurationNanos":
                    return RequestLog::responseDurationNanos;
                case "responseLength":
                    return RequestLog::responseLength;
                case "responseCause":
                    return log -> handleThrowable(log.responseCause());
                case "responseContentPreview":
                    return RequestLog::responseContentPreview;

                case "totalDurationMillis":
                    return log -> Duration.ofNanos(log.totalDurationNanos()).toMillis();
                case "totalDurationNanos":
                    return RequestLog::totalDurationNanos;

                case "sessionProtocol":
                    return RequestLog::sessionProtocol;
                case "serializationFormat":
                    return log -> log.scheme().serializationFormat();
                case "scheme":
                    return RequestLog::scheme;
                case "host":
                    return log -> {
                        final String authority = log.requestHeaders().authority();
                        if ("?".equals(authority)) {
                            final InetSocketAddress remoteAddr = log.context().remoteAddress();
                            assert remoteAddr != null;
                            return remoteAddr.getHostString();
                        }
                        return authority;
                    };
                case "status":
                    return log -> log.responseHeaders().status();
                case "statusCode":
                    return log -> log.responseHeaders().status().code();

                default:
                    throw new IllegalArgumentException("unexpected request log variable: " + variable);
            }
        }
A {@link RequestLog} component of a log message.
core/src/main/java/com/linecorp/armeria/server/logging/AccessLogComponent.java