<configuration>
    <appender name="Loki" class="pl.tkowalcz.tjahzi.logback.LokiAppender">
        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
            <level>INFO</level>
        </filter>
        <url>http://132.126.207.126:33100/loki/api/v1/push</url>
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [${HOSTNAME}] %-5level ${PID:- } --- [%t] %-40.40logger{39} #@# : %m%n</pattern>
        </encoder>
        <label>
            <name>app</name>
            <value>service-task</value>
        </label>
        <label>
            <name>host</name>
            <value>${HOSTNAME}</value>
        </label>
        <label>
            <name>task_id</name>
            <value>${task_id:- }</value>
        </label>
        <label>
            <name>hdfs</name>
            <value>${hdfs:- }</value>
        </label>
        <label>
            <name>key</name>
            <value>${key:- }</value>
        </label>
        <label>
            <name>app_id</name>
            <value>${_APP_ID:- }</value>
        </label>
        <label>
            <name>container_id</name>
            <value>${CONTAINER_ID:- }</value>
        </label>
        <logLevelLabel>level</logLevelLabel>
    </appender>

    <appender name="File" class="ch.qos.logback.core.FileAppender">
        <file>run.log</file>
        <append>false</append>
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [${HOSTNAME}] %-5level ${PID:- } --- [%t] %-40.40logger{39} #@# : %m%n</pattern>
        </encoder>
    </appender>

    <appender name="Console" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [${HOSTNAME}] %-5level ${PID:- } --- [%t] %-40.40logger{39} #@# : %m%n</pattern>
        </encoder>
    </appender>

    <root level="INFO">
        <appender-ref ref="Loki"/>
        <appender-ref ref="File"/>
        <appender-ref ref="Console"/>
    </root>

    <logger name="org.apache.hadoop.conf.Configuration" level="ERROR"/>
    <logger name="org.apache.hadoop.util.NativeCodeLoader" level="ERROR"/>
    <logger name="org.apache.hadoop.hdfs.shortcircuit.DomainSocketFactory" level="ERROR"/>
    <logger name="akka" level="ERROR"/>
    <logger name="org.apache.flink.runtime" level="ERROR"/>
    <logger name="org.apache.flink.runtime.taskexecutor.TaskExecutor" level="WARN"/>
    <logger name="org.apache.flink.core.plugin.PluginConfig" level="ERROR"/>

    <logger name="org.apache.hudi" level="INFO"/>
    <logger name="com.lanyuanxiaoyao.service.executor.task" level="INFO"/>
</configuration>