<?xml version="1.0" encoding="UTF-8"?>
<!-- configuration file for LogBack (slf4J implementation)
See here for more details: http://gordondickens.com/wordpress/2013/03/27/sawing-through-the-java-loggers/ -->
<configuration>

	<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
	<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
	<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />

    <property name="app_name" value="mhez-admin" />
    <timestamp key="dayStr" datePattern="yyyyMMdd"/>
    <property name="log_path" value="/logs/admin" />

    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(%-40.40logger{39}){cyan} %clr(%-4L){cyan} [${app_name}] %m%n%wEx</pattern>
        </encoder>
    </appender>

	<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${log_path}/${app_name}-${hostName}.log</file>
		<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
			<fileNamePattern>${log_path}/${app_name}-%d{yyyy-MM-dd}-%i-${hostName}.log</fileNamePattern>
			<MaxFileSize>100MB</MaxFileSize>
			<maxHistory>7</maxHistory>
		</rollingPolicy>
		<encoder>
			<pattern>%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(%-40.40logger{39}){cyan} %clr(%-4L){cyan} [${app_name}] %m%n%wEx</pattern>
		</encoder>
	</appender>

	<springProfile name="local,dev">
	    <root level="debug">
	        <appender-ref ref="console"/>
	        <appender-ref ref="FILE"/>
	   	</root>

		<logger name="org.springframework" level="info"/>
		<logger name="org.springframework.security" level="info"/>
		<logger name="org.springframework.boot" level="info"/>
		<logger name="com.zaxxer.hikari.HikariConfig" level="info"/>
		<logger name="reactor.netty" level="info" />
	    <logger name="io.lettuce.core" level="info" />
		<logger name="org.thymeleaf" level="info"/>
		<logger name="com.lguplus" level="info"/>

		<logger name="io.netty" level="info" />
	    <logger name="org.mybatis" level="info" />
	    <logger name="com.zaxxer.hikari" level="info" />

	    <logger name="kr.co.uplus" level="debug" />

	    <!-- DB 관련 -->
	    <logger name="jdbc" level="OFF"/>
	    <logger name="jdbc.sqlonly" level="OFF" />
	    <logger name="jdbc.sqltiming" level="DEBUG" />
	    <logger name="jdbc.audit" level="OFF" />
	    <logger name="jdbc.resultset" level="OFF" />
	    <logger name="jdbc.resultsettable" level="DEBUG" />
	    <logger name="jdbc.connection" level="OFF" />
	    <logger name="org.mongodb.driver" level="OFF"/>

	</springProfile>


	<springProfile name="stg">
        <root level="info">
	        <appender-ref ref="FILE"/>
   		</root>

		<logger name="org.springframework" level="info"/>
		<logger name="org.springframework.security" level="info"/>
		<logger name="org.springframework.boot" level="info"/>
		<logger name="com.zaxxer.hikari.HikariConfig" level="info"/>
		<logger name="reactor.netty" level="info" />
	    <logger name="io.lettuce.core" level="info" />
		<logger name="org.thymeleaf" level="info"/>
		<logger name="com.lguplus" level="info"/>

		<logger name="io.netty" level="info" />
	    <logger name="org.mybatis" level="info" />
	    <logger name="com.zaxxer.hikari" level="info" />

	    <logger name="kr.co.uplus" level="info" />

	    <!-- DB 관련 -->
	    <logger name="jdbc" level="OFF"/>
	    <logger name="jdbc.sqlonly" level="OFF" />
	    <logger name="jdbc.sqltiming" level="OFF" />
	    <logger name="jdbc.audit" level="OFF" />
	    <logger name="jdbc.resultset" level="OFF" />
	    <logger name="jdbc.resultsettable" level="OFF" />
	    <logger name="jdbc.connection" level="OFF" />
	    <logger name="org.mongodb.driver" level="OFF"/>
	</springProfile>


	<springProfile name="prd">
        <root level="info">
	        <appender-ref ref="FILE"/>
   		</root>

		<logger name="org.springframework" level="warn"/>
		<logger name="org.springframework.security" level="warn"/>
		<logger name="org.springframework.boot" level="warn"/>
		<logger name="com.zaxxer.hikari.HikariConfig" level="warn"/>
		<logger name="reactor.netty" level="warn" />
	    <logger name="io.lettuce.core" level="warn" />
		<logger name="org.thymeleaf" level="warn"/>
		<logger name="com.lguplus" level="warn"/>

		<logger name="io.netty" level="warn" />
	    <logger name="org.mybatis" level="warn" />
	    <logger name="com.zaxxer.hikari" level="warn" />

	    <logger name="kr.co.uplus" level="info" />

	    <!-- DB 관련 -->
	    <logger name="jdbc" level="OFF"/>
	    <logger name="jdbc.sqlonly" level="OFF" />
	    <logger name="jdbc.sqltiming" level="OFF" />
	    <logger name="jdbc.audit" level="OFF" />
	    <logger name="jdbc.resultset" level="OFF" />
	    <logger name="jdbc.resultsettable" level="OFF" />
	    <logger name="jdbc.connection" level="OFF" />
	    <logger name="org.mongodb.driver" level="OFF"/>

	</springProfile>
</configuration>
