diff --git a/ansible/roles/stack-sunbird/templates/dial-service_logback.xml b/ansible/roles/stack-sunbird/templates/dial-service_logback.xml index c5ad5f4e9a4c2868e0ce8813597a0cb705212133..cd44d311bcf0b02f02f4454347bb4e079f656322 100644 --- a/ansible/roles/stack-sunbird/templates/dial-service_logback.xml +++ b/ansible/roles/stack-sunbird/templates/dial-service_logback.xml @@ -25,30 +25,31 @@ <appender name="kafka-appender" class="com.github.danielwegener.logback.kafka.KafkaAppender"> - <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> - <pattern>%msg</pattern> + <encoder class="com.github.danielwegener.logback.kafka.encoding.LayoutKafkaMessageEncoder"> + <layout class="ch.qos.logback.classic.PatternLayout"> + <pattern>%msg</pattern> + </layout> </encoder> <topic>{{env_name}}.telemetry.raw</topic> - <!-- ensure that every message sent by the executing host is partitioned to the same partition strategy --> - <keyingStrategy class="com.github.danielwegener.logback.kafka.keying.NoKeyKeyingStrategy" /> - <!-- block the logging application thread if the kafka appender cannot keep up with sending the log messages --> - <deliveryStrategy class="com.github.danielwegener.logback.kafka.delivery.AsynchronousDeliveryStrategy" /> + <!-- we don't care how the log messages will be partitioned --> + <keyingStrategy class="com.github.danielwegener.logback.kafka.keying.RoundRobinKeyingStrategy" /> + <!-- use async delivery. the application threads are not blocked by logging --> + <deliveryStrategy class="com.github.danielwegener.logback.kafka.delivery.AsynchronousDeliveryStrategy" /> <!-- each <producerConfig> translates to regular kafka-client config (format: key=value) --> - <!-- producer configs are documented here: https://kafka.apache.org/documentation.html#newproducerconfigs --> - <!-- bootstrap.servers is the only mandatory producerConfig --> + <!-- producer configs are documented here: https://kafka.apache.org/documentation.html#newproducerconfigs --> + <!-- bootstrap.servers is the only mandatory producerConfig --> <producerConfig>bootstrap.servers={{lp_kafka_url}}</producerConfig> <!-- don't wait for a broker to ack the reception of a batch. --> - <producerConfig>acks=0</producerConfig> - <!-- wait up to 1000ms and collect log messages before sending them as a batch --> - <producerConfig>linger.ms=15000</producerConfig> - <!-- even if the producer buffer runs full, do not block the application but start to drop messages --> - <producerConfig>max.block.ms=0</producerConfig> - <!-- define a client-id that you use to identify yourself against the kafka broker --> - <producerConfig>client.id=${HOSTNAME}-${CONTEXT_NAME}-logback-relaxed</producerConfig> - - <!-- there is no fallback <appender-ref>. If this appender cannot deliver, it will drop its messages. --> + <producerConfig>acks=0</producerConfig> + <!-- wait up to 1000ms and collect log messages before sending them as a batch --> + <producerConfig>linger.ms=1000</producerConfig> + <!-- even if the producer buffer runs full, do not block the application but start to drop messages --> + <producerConfig>block.on.buffer.full=false</producerConfig> + <!-- define a client-id that you use to identify yourself against the kafka broker --> + <producerConfig>client.id=${HOSTNAME}-${CONTEXT_NAME}-logback-relaxed</producerConfig> + <!-- there is no fallback <appender-ref>. If this appender cannot deliver, it will drop its messages. --> </appender>