@Override
    public void log(RequestLog log) {
        final V value = valueExtractor.apply(log);
        if (value == null) {
            return;
        }

        final K key = keyExtractor.apply(log);
        final ProducerRecord<K, V> producerRecord = new ProducerRecord<>(topic, key, value);
        producer.send(producerRecord, (metadata, exception) -> {
            if (exception != null) {
                logger.warn("Failed to send a record to Kafka: {}", producerRecord, exception);
            }
        });
    }
Creates a new instance.

@param producer a Kafka {@link Producer} which is used to send logs to Kafka
@param topic the name of topic which is used to send logs
@param keyExtractor a {@link Function} that extracts a {@code K}-typed record key from
                    a {@link RequestLog}. The {@link Function} is allowed to return {@code null}
                    to leave the record key unspecified.
@param valueExtractor a {@link Function} that extracts a {@code V}-typed record value from
                      a {@link RequestLog}. The {@link Function} is allowed to return {@code null}
                      to skip logging for the given {@link RequestLog}.
kafka/src/main/java/com/linecorp/armeria/server/logging/kafka/KafkaAccessLogWriter.java