<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO">
    <Appenders>
        <Console name="ConsoleAppender" target="SYSTEM_OUT">
            <Filters>
                <MarkerFilter marker="LOG4JDBC_SQL" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
                <MarkerFilter marker="LOG4JDBC_EXCEPTION" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
                <MarkerFilter marker="LOG4JDBC_RESULTSETTABLE" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
                <MarkerFilter marker="LOG4JDBC_NON_STATEMENT" onMatch="DENY" onMismatch="NEUTRAL"/>
                <MarkerFilter marker="LOG4JDBC_OTHER" onMatch="DENY" onMismatch="NEUTRAL"/>
            </Filters>
            <PatternLayout>
                <Pattern>[%-5p] %d{yyyy-MM-dd HH:mm:ss} %c %n%m%n</Pattern>
            </PatternLayout>
        </Console>
        <RollingFile name="FileAppender" fileName="/logs/sdl-${date:yyyy-MM-dd}-${hostName}.log" filePattern="/logs/sdl/sdl-%d{yyyy-MM-dd}-${hostName}.log">
            <Filters>
                <MarkerFilter marker="LOG4JDBC_SQL" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
                <MarkerFilter marker="LOG4JDBC_EXCEPTION" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
                <MarkerFilter marker="LOG4JDBC_NON_STATEMENT" onMatch="DENY" onMismatch="NEUTRAL"/>
                <MarkerFilter marker="LOG4JDBC_OTHER" onMatch="DENY" onMismatch="NEUTRAL"/>
            </Filters>
            <PatternLayout>
                <Pattern>[%-5p] %d{yyyy-MM-dd HH:mm:ss} %c %n%m%n</Pattern>
            </PatternLayout>
            <Policies>
                <TimeBasedTriggeringPolicy interval="1" modulate="true" />
            </Policies>
        </RollingFile>
        <RollingFile name="ApprovalAppender" fileName="/logs/approval/approval-${date:yyyy-MM-dd}-${hostName}.log" filePattern="/logs/approval/approval-%d{yyyy-MM-dd}-${hostName}.log">
            <PatternLayout>
                <Pattern>[%-5p] %d{yyyy-MM-dd HH:mm:ss} %c %n%m%n</Pattern>
            </PatternLayout>
            <Policies>
                <TimeBasedTriggeringPolicy interval="1" modulate="true" />
            </Policies>
        </RollingFile>
        <RollingFile name="AccessLogAppender" fileName="/logs/access/access-${date:yyyy-MM-dd}-${hostName}.log" filePattern="/logs/access/access-%d{yyyy-MM-dd}-${hostName}.log">
            <PatternLayout>
                <Pattern>%d %-5p [%t] %-17c{2} \(%13F:%L\)     - %m%n</Pattern>
            </PatternLayout>
            <Policies>
                <TimeBasedTriggeringPolicy interval="1" modulate="true" />
            </Policies>
        </RollingFile>
        <RollingFile name="UserHistoryAppender" fileName="/logs/history/user-history-${date:yyyy-MM-dd}-${hostName}.log" filePattern="/logs/history/user-history-%d{yyyy-MM-dd}-${hostName}.log">
            <PatternLayout>
                <Pattern>%d %-5p [%t] %-17c{2} \(%13F:%L\)     - %m%n</Pattern>
            </PatternLayout>
            <Policies>
                <TimeBasedTriggeringPolicy interval="1" modulate="true" />
            </Policies>
        </RollingFile>
        <RollingFile name="RoleHistoryAppender" fileName="/logs/history/role-history-${date:yyyy-MM-dd}-${hostName}.log" filePattern="/logs/history/role-history-%d{yyyy-MM-dd}-${hostName}.log">
            <PatternLayout>
                <Pattern>%d %-5p [%t] %-17c{2} \(%13F:%L\)     - %m%n</Pattern>
            </PatternLayout>
            <Policies>
                <TimeBasedTriggeringPolicy interval="1" modulate="true" />
            </Policies>
        </RollingFile>
        <RollingFile name="WorkgroupHistoryAppender" fileName="/logs/history/workgroup-history-${date:yyyy-MM-dd}-${hostName}.log" filePattern="/logs/history/workgroup-history-%d{yyyy-MM-dd}-${hostName}.log">
            <PatternLayout>
                <Pattern>%d %-5p [%t] %-17c{2} \(%13F:%L\)     - %m%n</Pattern>
            </PatternLayout>
            <Policies>
                <TimeBasedTriggeringPolicy interval="1" modulate="true" />
            </Policies>
        </RollingFile>
    </Appenders>

    <Loggers>
        <Logger name="UserHistoryLog" level="INFO" additivity="false">
            <AppenderRef ref="UserHistoryAppender"/>
        </Logger>
        <Logger name="RoleHistoryLog" level="INFO" additivity="false">
            <AppenderRef ref="RoleHistoryAppender"/>
        </Logger>
        <Logger name="WorkgroupHistoryLog" level="INFO" additivity="false">
            <AppenderRef ref="WorkgroupHistoryAppender"/>
        </Logger>
        <Logger name="AccessLog" level="DEBUG" additivity="false">
            <AppenderRef ref="AccessLogAppender"/>
            <AppenderRef ref="ConsoleAppender"/>
        </Logger>
        <Logger name="org.springframework.context" level="INFO" additivity="false">
            <AppenderRef ref="FileAppender"/>
            <AppenderRef ref="ConsoleAppender"/>
        </Logger>
        <Logger name="com.samsung.approval" level="DEBUG" additivity="false">
            <AppenderRef ref="ApprovalAppender"/>
            <AppenderRef ref="ConsoleAppender"/>
        </Logger>
        <Logger name="com.samsung" level="DEBUG" additivity="false">
            <AppenderRef ref="FileAppender"/>
            <AppenderRef ref="ConsoleAppender"/>
        </Logger>
        <Logger name="com.samsung.excel" level="OFF" additivity="false">
            <AppenderRef ref="FileAppender"/>
            <AppenderRef ref="ConsoleAppender"/>
        </Logger>
        <!-- SQL  Logging Start -->
        <Logger name="log4jdbc.log4j2" level="INFO" additivity="false">
            <AppenderRef ref="FileAppender"/>
            <AppenderRef ref="ConsoleAppender"/>
        </Logger>

        <!-- SQL  Logging End -->
        <Root level="ERROR">
            <AppenderRef ref="FileAppender" />
            <AppenderRef ref="ConsoleAppender"/>
        </Root>
    </Loggers>
</Configuration>