<configuration>

    <contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator"/>

    <appender name="SystemLogAppender" class="com.github.danielwegener.logback.kafka.KafkaAppender">
        <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
            <layout class="ru.sbt.logback.layout.Grok">
                <message>message</message>
                <timestamp>timestamp</timestamp>
                <level>level</level>
                <projectName>testProjectSystem</projectName>
                <pod>testPodSystem</pod>
                <deployment>testDeploymentSystem</deployment>
                <needAddThreadToMessage>false</needAddThreadToMessage>
            </layout>
        </encoder>
        <deliveryStrategy class="com.github.danielwegener.logback.kafka.delivery.AsynchronousDeliveryStrategy"/>
        <topic>system-logs</topic>
        <producerConfig>bootstrap.servers=localhost:9092</producerConfig>
        <producerConfig>security.protocol=SSL</producerConfig>
        <producerConfig>ssl.keystore.location={path to jks file}</producerConfig>
        <producerConfig>ssl.keystore.password={password}</producerConfig>
        <producerConfig>ssl.truststore.location={path to jks file}</producerConfig>
        <producerConfig>ssl.truststore.password={password}</producerConfig>
    </appender>

    <appender name="BusinessLogAppender" class="com.github.danielwegener.logback.kafka.KafkaAppender">
        <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
            <layout class="ru.sbt.logback.layout.Grok">
                <message>message</message>
                <timestamp>timestamp</timestamp>
                <level>level</level>
                <projectName>testProjectBusiness</projectName>
                <pod>testPodBusiness</pod>
                <deployment>testDeploymentBusiness</deployment>
                <needAddThreadToMessage>false</needAddThreadToMessage>
                <transformationLog>true</transformationLog>
                <fields>
                    <![CDATA[
                        name=operationName MDC=operationName
                    ]]>
                </fields>
            </layout>
        </encoder>
        <deliveryStrategy class="com.github.danielwegener.logback.kafka.delivery.AsynchronousDeliveryStrategy"/>
        <topic>business-logs</topic>
        <producerConfig>bootstrap.servers=localhost:9092</producerConfig>
        <producerConfig>security.protocol=SSL</producerConfig>
        <producerConfig>ssl.keystore.location={path to jks file}</producerConfig>
        <producerConfig>ssl.keystore.password={password}</producerConfig>
        <producerConfig>ssl.truststore.location={path to jks file}</producerConfig>
        <producerConfig>ssl.truststore.password={password}</producerConfig>
    </appender>

    <!--Используется, если не указан параметр logLevel при запуске джобы-->
    <logger name="ru.sbt.cep.flow.event.process.flow.function.EventHolderTransformer" level="INFO" additivity="false">
        <appender-ref ref="BusinessLogAppender"/>
    </logger>

    <logger name="EventProcessTest" level="info">
        <appender-ref ref="BusinessLogAppender"/>
    </logger>

    <logger name="akka" level="INFO">
        <appender-ref ref="SystemLogAppender"/>
    </logger>
    <logger name="org.apache.kafka" level="INFO">
        <appender-ref ref="SystemLogAppender"/>
    </logger>
    <logger name="org.apache.hadoop" level="INFO">
        <appender-ref ref="SystemLogAppender"/>
    </logger>
    <logger name="org.apache.zookeeper" level="INFO">
        <appender-ref ref="SystemLogAppender"/>
    </logger>
</configuration>