<?xml version="1.0" encoding="UTF-8"?>
<configuration>

    <!--로그 파일 저장 위치-->
    <property name="LOGS_PATH" value="./logs"/>
    
<!--  프로파일 지정 : application-dev.properties 파일 생성,   -Dspring.profiles.active=dev 옵션으로 실행 -->
<!--     <springProfile name="dev"> -->
<!--         <property name="LOGS_PATH" value="./logs/dev"/> -->
<!--     </springProfile> -->

	<property name="LOG_PATTERN" value="%magenta([%d{yyyy-MM-dd HH:mm:ss.SSS}]) %highlight(%-5level) %cyan([%15.15thread]) %boldYellow(%-40.40logger{37}) - %msg%n" />
	<property name="FILE_LOG_PATTERN" value="[%d{yyyy-MM-dd HH:mm:ss.SSS}] %-5level [%15.15thread] %-40.40logger{37} - %msg%n" />


	<!-- 	실제 로그를 출력 방법 (함수) -->
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>${LOG_PATTERN}</pattern>		
        </encoder>
    </appender>

    <appender name="DAILY_ROLLING_FILE_APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${LOGS_PATH}/logback.log</file>
        <encoder>
            <pattern>${FILE_LOG_PATTERN}</pattern>
        </encoder>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>${LOGS_PATH}/logback.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
                <!-- or whenever the file size reaches 100MB -->
				<maxFileSize>5MB</maxFileSize>
                <!-- kb, mb, gb -->
            </timeBasedFileNamingAndTriggeringPolicy>
            <maxHistory>30</maxHistory>
        </rollingPolicy>
    </appender>

	<!-- 출력 방식 정의, (패키지 단위 지정, appender 지정) -->
	<!-- level=OFF : log 안남김 -->
    <logger name="kr.gmtc.eyegw" level="INFO">
        <appender-ref ref="DAILY_ROLLING_FILE_APPENDER" />
    </logger>
    
    

	<!-- 전체 logback 에 대한 default 설정 -->
    <root level="INFO">
        <appender-ref ref="STDOUT" />
        <appender-ref ref="DAILY_ROLLING_FILE_APPENDER" />
    </root>
</configuration>