<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds">
    <shutdownHook class="ch.qos.logback.core.hook.DelayingShutdownHook"/>

    <property name="APP_CLASS_PATH"  value="com.its.bis"/>
    <property name="PROJECT_PREFIX"  value="vms"/>
    <property name="PROJECT_NAME"    value="${PROJECT_PREFIX}-comm-server"/>
    <property name="ROOT_LOG_LEVEL"  value="INFO"/>
    <property name="LOG_CHARSET"     value="UTF-8" />
    <property name="LOG_PATH"        value="${user.dir}/logs/"/>
    <property name="LOG_BACKUP_PATH" value="${user.dir}/logs/backup/"/>

    <property name="LOG_FILE_NAME"             value="${PROJECT_NAME}.log"/>
    <property name="LOG_FILE_NAME_ERROR"       value="${PROJECT_NAME}.err.log"/>
    <property name="LOG_FILE_NAME_PATTERN"     value="%d{yyyyMMdd}_%i.log.gz"/>
    <property name="LOG_FILE_NAME_PACKET"      value="${PROJECT_PREFIX}-packet"/>
    <property name="LOG_FILE_NAME_SESSION"     value="${PROJECT_PREFIX}-session.log"/>
    <property name="LOG_FILE_NAME_CENTER_COMM" value="${PROJECT_PREFIX}-center-comm.log"/>
    <property name="LOG_FILE_NAME_SQL"         value="${PROJECT_PREFIX}-sql.log"/>
    <property name="LOG_FILE_NAME_SCHEDULE"    value="${PROJECT_PREFIX}-schedule.log"/>
    <property name="LOG_FILE_NAME_STATISTICS"  value="${PROJECT_PREFIX}-statistics.log"/>

    <property name="MAX_FILESIZE" value="10MB"/>
    <property name="MAX_HISTORY"  value="30"/>
    <property name="LOG_PATTERN_FILE"        value="[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] %msg%n"/>
    <property name="LOG_PATTERN_ERROR"       value="[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%30t] [%5level] %42logger{35}.%-20M ${PID:-} %n%msg%n"/>
    <property name="LOG_PATTERN_PACKET"      value="[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] %msg%n"/>
    <property name="LOG_PATTERN_SESSION"     value="[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] %msg%n"/>
    <property name="LOG_PATTERN_CENTER_COMM" value="[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] %msg%n"/>
    <property name="LOG_PATTERN_SQL"         value="[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] %msg%n"/>
    <property name="LOG_PATTERN_SCHEDULE"    value="[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] %msg%n"/>
    <property name="LOG_PATTERN_STATISTICS"  value="[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] %msg%n"/>
<!--    <property name="LOG_PATTERN_CONSOLE"     value="[%d{HH:mm:ss.SSS}] %highlight([%5level]) %highlight(${PID:-}): %cyan(%msg) %n"/>-->
    <property name="LOG_PATTERN_CONSOLE"     value="[%d{HH:mm:ss.SSS}] [%5level] %msg %n"/>

    <springProfile name="!xxx">
        <include resource="logback-spring-appender.xml"/>
    </springProfile>

    <root level="INFO">
        <appender-ref ref="CONSOLE"/>
        <appender-ref ref="FILE_LOG"/>
        <appender-ref ref="FILE_ERROR"/>
    </root>

    <logger name="${APP_CLASS_PATH}.xnettcp" level="INFO" additivity="false">
        <appender-ref ref="FILE_PACKET"/>
        <appender-ref ref="FILE_ERROR"/>
    </logger>

    <logger name="${APP_CLASS_PATH}.xnetudp" level="INFO" additivity="false">
        <appender-ref ref="CONSOLE"/>
        <appender-ref ref="CENTER_COMM"/>
        <appender-ref ref="FILE_ERROR"/>
    </logger>

    <logger name="${APP_CLASS_PATH}.xnettcp" level="INFO" additivity="true">
        <appender-ref ref="FILE_SESSION"/>
        <appender-ref ref="FILE_ERROR"/>
    </logger>

    <logger name="${APP_CLASS_PATH}.service.StatisticsServices" level="INFO" additivity="false">
        <appender-ref ref="CONSOLE"/>
        <appender-ref ref="FILE_STATISTICS"/>
        <appender-ref ref="FILE_ERROR"/>
    </logger>

    <logger name="${APP_CLASS_PATH}.scheduler" level="INFO" additivity="false">
        <appender-ref ref="CONSOLE"/>
        <appender-ref ref="FILE_SCHEDULE"/>
        <appender-ref ref="FILE_ERROR"/>
    </logger>

    <logger name="jdbc"                level="OFF"   additivity="false"> <appender-ref ref="FILE_SQL" /> <appender-ref ref="FILE_ERROR"/> </logger>
    <logger name="jdbc.sqlonly"        level="INFO"  additivity="false"> <appender-ref ref="FILE_SQL" /> <appender-ref ref="FILE_ERROR"/> </logger>
    <logger name="jdbc.sqltiming"      level="DEBUG" additivity="false"> <appender-ref ref="FILE_SQL" /> <appender-ref ref="FILE_ERROR"/> </logger>
    <logger name="jdbc.audit"          level="OFF"   additivity="false"> <appender-ref ref="FILE_SQL" /> <appender-ref ref="FILE_ERROR"/> </logger>
    <logger name="jdbc.resultset"      level="INFO"  additivity="false"> <appender-ref ref="FILE_SQL" /> <appender-ref ref="FILE_ERROR"/> </logger>
    <logger name="jdbc.resultsettable" level="INFO"  additivity="false"> <appender-ref ref="FILE_SQL" /> <appender-ref ref="FILE_ERROR"/> </logger>
    <logger name="jdbc.connection"     level="INFO"  additivity="false"> <appender-ref ref="FILE_SQL" /> <appender-ref ref="FILE_ERROR"/> </logger>

</configuration>
