laviua/komock

View on GitHub
komock-app/src/main/resources/logback.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <statusListener class="ch.qos.logback.core.status.NopStatusListener" />

    <property name="CONSOLE_LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss} %yellow([%thread]) %highlight(%-5level) %cyan(%logger{36}) - %msg%n"/>
    <property name="FILE_LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"/>
    <property name="LOG_DIRECTORY" value="${LOG_DIRECTORY:-./logs}"/>
    <property name="LOG_FILENAME" value="komock"/>
    <property name="LOG_FILE" value="${LOG_DIRECTORY}/${LOG_FILENAME}"/>
    <property name="LOG_HISTORY_FILE" value="${LOG_DIRECTORY}/history/${LOG_FILENAME}"/>

    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <encoder>
            <pattern>${FILE_LOG_PATTERN}</pattern>
        </encoder>
        <file>${LOG_FILE}.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>${LOG_HISTORY_FILE}.%d{yyyy-MM-dd}.log</fileNamePattern>
        </rollingPolicy>
    </appender>

    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>${CONSOLE_LOG_PATTERN}</pattern>
        </encoder>
    </appender>


    <logger name="org.eclipse.jetty" level="WARN"/>
    <logger name="io.netty" level="INFO"/>

    <root level="INFO">
        <appender-ref ref="CONSOLE" />
        <appender-ref ref="FILE"/>
    </root>
</configuration>