All Downloads are FREE. Search and download functionalities are using the official Maven repository.

logback.kafka-appender.xml Maven / Gradle / Ivy

<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~  Copyright 1999-2019 Seata.io Group.
  ~
  ~  Licensed under the Apache License, Version 2.0 (the "License");
  ~  you may not use this file except in compliance with the License.
  ~  You may obtain a copy of the License at
  ~
  ~       http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~  Unless required by applicable law or agreed to in writing, software
  ~  distributed under the License is distributed on an "AS IS" BASIS,
  ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~  See the License for the specific language governing permissions and
  ~  limitations under the License.
  -->

<included>
    <!-- kafka-appender properties -->
    <springProperty name="KAFKA_BOOTSTRAP_SERVERS" source="logging.extend.kafka-appender.bootstrap-servers"
                    defaultValue="127.0.0.1:9092"/>
    <springProperty name="KAFKA_TOPIC" source="logging.extend.kafka-appender.topic"
                    defaultValue="logback_to_logstash"/>

    <appender name="KAFKA" class="com.github.danielwegener.logback.kafka.KafkaAppender">
        <encoder>
            <!--<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS}|%p|${APPLICATION_NAME:-seata-server}|${RPC_PORT:-0}|%t|%logger|%X{X-TX-XID:-}|%X{X-TX-BRANCH-ID:-}|%m|%wex</pattern>-->
            <pattern>{
    "@timestamp": "%d{yyyy-MM-dd HH:mm:ss.SSS}",
    "level":"%p",
    "app_name":"${APPLICATION_NAME:-seata-server}",
    "PORT": ${RPC_PORT:-0},
    "thread_name": "%t",
    "logger_name": "%logger",
    "X-TX-XID": "%X{X-TX-XID:-}",
    "X-TX-BRANCH-ID": "%X{X-TX-BRANCH-ID:-}",
    "message": "%m",
    "stack_trace": "%wex"
}
            </pattern>
        </encoder>
        <topic>${KAFKA_TOPIC}</topic>
        <keyingStrategy class="com.github.danielwegener.logback.kafka.keying.NoKeyKeyingStrategy"/>
        <deliveryStrategy class="com.github.danielwegener.logback.kafka.delivery.AsynchronousDeliveryStrategy"/>
        <producerConfig>bootstrap.servers=${KAFKA_BOOTSTRAP_SERVERS}</producerConfig>
        <producerConfig>acks=0</producerConfig>
        <producerConfig>linger.ms=1000</producerConfig>
        <producerConfig>max.block.ms=0</producerConfig>
    </appender>
</included>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy