Class KafkaStructuredLoggingService<I extends com.linecorp.armeria.common.Request,O extends com.linecorp.armeria.common.Response,L>
- java.lang.Object
-
- com.linecorp.armeria.common.util.AbstractUnwrappable<com.linecorp.armeria.server.Service<T_I,T_O>>
-
- com.linecorp.armeria.server.DecoratingService<I,O,I,O>
-
- com.linecorp.armeria.server.SimpleDecoratingService<I,O>
-
- com.linecorp.armeria.server.logging.structured.StructuredLoggingService<I,O,L>
-
- com.linecorp.armeria.server.logging.structured.kafka.KafkaStructuredLoggingService<I,O,L>
-
- All Implemented Interfaces:
com.linecorp.armeria.common.util.Unwrappable,com.linecorp.armeria.server.Service<I,O>
@Deprecated public class KafkaStructuredLoggingService<I extends com.linecorp.armeria.common.Request,O extends com.linecorp.armeria.common.Response,L> extends com.linecorp.armeria.server.logging.structured.StructuredLoggingService<I,O,L>
Deprecated.UseKafkaAccessLogWriter.Kafka backend for service log logging. This class enable Kafka as a service log logging backend.This method returns immediately after the
Producer.send(ProducerRecord, Callback)returns rather than waiting for returnedFuturecompletes so logs which are written and are not yet flushed can be lost if an application crashes in unclean way.Refer variety of
newDecorator(org.apache.kafka.clients.producer.Producer<byte[], L>, java.lang.String, com.linecorp.armeria.server.logging.structured.StructuredLogBuilder<L>, com.linecorp.armeria.server.logging.structured.kafka.KafkaStructuredLoggingService.KeySelector<L>)methods to see how to enable Kafka based structured logging.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceKafkaStructuredLoggingService.KeySelector<E>Deprecated.Implements "key" selector of Kafka based service log writer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidclose()Deprecated.static <I extends com.linecorp.armeria.common.Request,O extends com.linecorp.armeria.common.Response,L>
Function<com.linecorp.armeria.server.Service<I,O>,com.linecorp.armeria.server.logging.structured.StructuredLoggingService<I,O,L>>newDecorator(String bootstrapServers, String topic, com.linecorp.armeria.server.logging.structured.StructuredLogBuilder<L> logBuilder)Deprecated.Creates a decorator which providesStructuredLoggingServicewith defaultProducerand defaulting key to null.static <I extends com.linecorp.armeria.common.Request,O extends com.linecorp.armeria.common.Response,L>
Function<com.linecorp.armeria.server.Service<I,O>,com.linecorp.armeria.server.logging.structured.StructuredLoggingService<I,O,L>>newDecorator(String bootstrapServers, String topic, com.linecorp.armeria.server.logging.structured.StructuredLogBuilder<L> logBuilder, KafkaStructuredLoggingService.KeySelector<L> keySelector)Deprecated.Creates a decorator which providesStructuredLoggingServicewith defaultProducer.static <I extends com.linecorp.armeria.common.Request,O extends com.linecorp.armeria.common.Response,L>
Function<com.linecorp.armeria.server.Service<I,O>,com.linecorp.armeria.server.logging.structured.StructuredLoggingService<I,O,L>>newDecorator(Producer<byte[],L> producer, String topic, com.linecorp.armeria.server.logging.structured.StructuredLogBuilder<L> logBuilder)Deprecated.Creates a decorator which providesStructuredLoggingServicewith defaulting key to null.static <I extends com.linecorp.armeria.common.Request,O extends com.linecorp.armeria.common.Response,L>
Function<com.linecorp.armeria.server.Service<I,O>,com.linecorp.armeria.server.logging.structured.StructuredLoggingService<I,O,L>>newDecorator(Producer<byte[],L> producer, String topic, com.linecorp.armeria.server.logging.structured.StructuredLogBuilder<L> logBuilder, KafkaStructuredLoggingService.KeySelector<L> keySelector)Deprecated.Creates a decorator which providesStructuredLoggingServicewith full set of arguments.protected voidwriteLog(com.linecorp.armeria.common.logging.RequestLog log, L structuredLog)Deprecated.-
Methods inherited from class com.linecorp.armeria.server.logging.structured.StructuredLoggingService
serve, serviceAdded
-
Methods inherited from class com.linecorp.armeria.common.util.AbstractUnwrappable
as, delegate, toString
-
-
-
-
Method Detail
-
newDecorator
public static <I extends com.linecorp.armeria.common.Request,O extends com.linecorp.armeria.common.Response,L> Function<com.linecorp.armeria.server.Service<I,O>,com.linecorp.armeria.server.logging.structured.StructuredLoggingService<I,O,L>> newDecorator(Producer<byte[],L> producer, String topic, com.linecorp.armeria.server.logging.structured.StructuredLogBuilder<L> logBuilder, @Nullable KafkaStructuredLoggingService.KeySelector<L> keySelector)
Deprecated.Creates a decorator which providesStructuredLoggingServicewith full set of arguments.- Type Parameters:
I- theRequesttypeO- theResponsetypeL- the type of the structured log representation- Parameters:
producer- a kafkaProducerproducer which is used to send logs to Kafkatopic- a name of topic which is used to send logslogBuilder- an instance ofStructuredLogBuilderwhich is used to construct a log entrykeySelector- aKafkaStructuredLoggingService.KeySelectorwhich is used to decide what key to use for the log- Returns:
- a service decorator which adds structured logging support integrated to Kafka
-
newDecorator
public static <I extends com.linecorp.armeria.common.Request,O extends com.linecorp.armeria.common.Response,L> Function<com.linecorp.armeria.server.Service<I,O>,com.linecorp.armeria.server.logging.structured.StructuredLoggingService<I,O,L>> newDecorator(Producer<byte[],L> producer, String topic, com.linecorp.armeria.server.logging.structured.StructuredLogBuilder<L> logBuilder)
Deprecated.Creates a decorator which providesStructuredLoggingServicewith defaulting key to null.- Type Parameters:
I- theRequesttypeO- theResponsetypeL- the type of the structured log representation- Parameters:
producer- a kafkaProducerproducer which is used to send logs to Kafkatopic- a name of topic which is used to send logslogBuilder- an instance ofStructuredLogBuilderwhich is used to construct a log entry- Returns:
- a service decorator which adds structured logging support integrated to Kafka
-
newDecorator
public static <I extends com.linecorp.armeria.common.Request,O extends com.linecorp.armeria.common.Response,L> Function<com.linecorp.armeria.server.Service<I,O>,com.linecorp.armeria.server.logging.structured.StructuredLoggingService<I,O,L>> newDecorator(String bootstrapServers, String topic, com.linecorp.armeria.server.logging.structured.StructuredLogBuilder<L> logBuilder, @Nullable KafkaStructuredLoggingService.KeySelector<L> keySelector)
Deprecated.Creates a decorator which providesStructuredLoggingServicewith defaultProducer.- Type Parameters:
I- theRequesttypeO- theResponsetypeL- the type of the structured log representation- Parameters:
bootstrapServers- abootstrap.serversconfig to specify destination Kafka clustertopic- a name of topic which is used to send logslogBuilder- an instance ofStructuredLogBuilderwhich is used to construct a log entrykeySelector- aKafkaStructuredLoggingService.KeySelectorwhich is used to decide what key to use for the log- Returns:
- a service decorator which adds structured logging support integrated to Kafka
-
newDecorator
public static <I extends com.linecorp.armeria.common.Request,O extends com.linecorp.armeria.common.Response,L> Function<com.linecorp.armeria.server.Service<I,O>,com.linecorp.armeria.server.logging.structured.StructuredLoggingService<I,O,L>> newDecorator(String bootstrapServers, String topic, com.linecorp.armeria.server.logging.structured.StructuredLogBuilder<L> logBuilder)
Deprecated.Creates a decorator which providesStructuredLoggingServicewith defaultProducerand defaulting key to null.- Type Parameters:
I- theRequesttypeO- theResponsetypeL- the type of the structured log representation- Parameters:
bootstrapServers- abootstrap.serversconfig to specify destination Kafka clustertopic- a name of topic which is used to send logslogBuilder- an instance ofStructuredLogBuilderwhich is used to construct a log entry- Returns:
- a service decorator which adds structured logging support integrated to Kafka
-
writeLog
protected void writeLog(com.linecorp.armeria.common.logging.RequestLog log, L structuredLog)Deprecated.
-
-