<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO">
	<Appenders>
		<Console name="console" target="SYSTEM_OUT">
			<PatternLayout charset="UTF-8" disableAnsi="false"
				pattern="%d{ISO8601}{GMT} %highlight{#%p}{FATAL=red blink, ERROR=red Bold, WARN=yellow bold, INFO=green Bold, DEBUG=white bold, TRACE=blue Bold} %style{request-%.-12X{chmm.RequestID}}{magenta} %style{session-%.-12X{chmm.SessionID}}{white} %style{%thread}{cyan} %style{%X{chmm.ClientIP}}{blue} %X{chmm.ClientID} %style{%X{chmm.RequestURL}}{yellow} %style{ %logger{36}}{green} %m%ex%n" />
		</Console>
		<RollingFile name="dailyRollingFile"
			fileName="./log/com.demo1.log"
			filePattern="./log/com.demo1/com.demo1.%d{yyyy-MM-dd}.log">
			<PatternLayout charset="UTF-8" disableAnsi="false"
				pattern="%d{ISO8601}{GMT} %highlight{#%p}{FATAL=red blink, ERROR=red Bold, WARN=yellow bold, INFO=green Bold, DEBUG=white bold, TRACE=blue Bold} %style{request-%.-12X{chmm.RequestID}}{magenta} %style{session-%.-12X{chmm.SessionID}}{white} %style{%thread}{cyan} %style{%X{chmm.ClientIP}}{blue} %X{chmm.ClientID} %style{%X{chmm.RequestURL}}{yellow} %style{ %logger{36}}{green} %m%ex%n" />
			<Policies>
				<TimeBasedTriggeringPolicy interval="1"
					modulate="true" />
			</Policies>
		</RollingFile>
		<RollingFile name="errorRollingFile"
			fileName="./log/com.demo1-error.log"
			filePattern="./log/com.demo1/com.demo1-error.%d{yyyy-MM-dd}.log">
			<PatternLayout charset="UTF-8" disableAnsi="false"
				pattern="%d{ISO8601}{GMT} %highlight{#%p}{FATAL=red blink, ERROR=red Bold, WARN=yellow bold, INFO=green Bold, DEBUG=white bold, TRACE=blue Bold} %style{request-%.-12X{chmm.RequestID}}{magenta} %style{session-%.-12X{chmm.SessionID}}{white} %style{%thread}{cyan} %style{%X{chmm.ClientIP}}{blue} %X{chmm.ClientID} %style{%X{chmm.RequestURL}}{yellow} %style{ %logger{36}}{green} %m%ex%n" />
			<Policies>
				<TimeBasedTriggeringPolicy interval="1"
					modulate="true" />
			</Policies>
		</RollingFile>
		<RollingFile name="sqlDailyRollingFile"
			fileName="./log/com.demo1-sql.log"
			filePattern="./log/com.demo1/com.demo1-sql.%d{yyyy-MM-dd}.log">
			<PatternLayout charset="UTF-8" disableAnsi="false"
				pattern="%d{ISO8601}{GMT} %highlight{#%p}{FATAL=red blink, ERROR=red Bold, WARN=yellow bold, INFO=green Bold, DEBUG=white bold, TRACE=blue Bold} %style{request-%.-12X{chmm.RequestID}}{magenta} %style{session-%.-12X{chmm.SessionID}}{white} %style{%thread}{cyan} %style{%X{chmm.ClientIP}}{blue} %X{chmm.ClientID} %style{%X{chmm.RequestURL}}{yellow} %style{ %logger{36}}{green} %m%ex%n" />
			<Policies>
				<TimeBasedTriggeringPolicy interval="1"
					modulate="true" />
			</Policies>
		</RollingFile>
		<RollingFile name="sqlErrorDailyRollingFile"
			fileName="./log/com.demo1-sql-error.log"
			filePattern="./log/com.demo1/com.demo1-sql-error.%d{yyyy-MM-dd}.log">
			<PatternLayout charset="UTF-8" disableAnsi="false"
				pattern="%d{ISO8601}{GMT} %highlight{#%p}{FATAL=red blink, ERROR=red Bold, WARN=yellow bold, INFO=green Bold, DEBUG=white bold, TRACE=blue Bold} %style{request-%.-12X{chmm.RequestID}}{magenta} %style{session-%.-12X{chmm.SessionID}}{white} %style{%thread}{cyan} %style{%X{chmm.ClientIP}}{blue} %X{chmm.ClientID} %style{%X{chmm.RequestURL}}{yellow} %style{ %logger{36}}{green} %m%ex%n" />
			<Policies>
				<TimeBasedTriggeringPolicy interval="1"
					modulate="true" />
			</Policies>
		</RollingFile>
	</Appenders>

	<Loggers>
		<!-- Root Logger -->
		<Root level="INFO">
			<AppenderRef ref="console" />
			<AppenderRef ref="dailyRollingFile" />
		</Root>

		<!-- chamomile logging -->
		<logger name="ChamomileErrorLogger" level="ERROR"
			additivity="false">
			<AppenderRef ref="console" />
			<AppenderRef ref="errorRollingFile" />
		</logger>
		<logger name="ChamomileUserAccessLogger" level="INFO"
			additivity="false">
			<AppenderRef ref="console" />
			<AppenderRef ref="dailyRollingFile" />
		</logger>
		<logger name="ChamomilePrivacyLogger" level="INFO"
			additivity="false">
			<AppenderRef ref="console" />
			<AppenderRef ref="dailyRollingFile" />
		</logger>
		<logger name="ChamomileFileStateLogger" level="INFO"
			additivity="false">
			<AppenderRef ref="console" />
			<AppenderRef ref="dailyRollingFile" />
		</logger>

		<!-- Application Loggers -->
		<logger name="net.lotte.chamomile.admin" level="DEBUG"
			additivity="false">
			<AppenderRef ref="console" />
			<AppenderRef ref="dailyRollingFile" />
		</logger>
		<logger
			name="net.lotte.chamomile.security.util.matcher.SerializableAntPathRequestMatcher"
			level="INFO" additivity="false">
			<AppenderRef ref="console" />
			<AppenderRef ref="dailyRollingFile" />
		</logger>

		<!-- 3rdparty Loggers -->
		<logger name="org.springframework.security" level="DEBUG"
			additivity="false">
			<AppenderRef ref="console" />
			<AppenderRef ref="dailyRollingFile" />
		</logger>
		<logger name="org.springframework.core" level="INFO"
			additivity="false">
			<AppenderRef ref="console" />
			<AppenderRef ref="dailyRollingFile" />
		</logger>
		<logger name="org.springframework.beans" level="INFO"
			additivity="false">
			<AppenderRef ref="console" />
			<AppenderRef ref="dailyRollingFile" />
		</logger>
		<logger name="org.springframework.context" level="INFO"
			additivity="false">
			<AppenderRef ref="console" />
			<AppenderRef ref="dailyRollingFile" />
		</logger>
		<logger name="org.springframework.web" level="INFO"
			additivity="false">
			<AppenderRef ref="console" />
			<AppenderRef ref="dailyRollingFile" />
		</logger>

		<!-- sql logging -->
		<logger name="java.sql" level="FATAL" additivity="false">
			<AppenderRef ref="console" />
			<AppenderRef ref="sqlDailyRollingFile" />
		</logger>
		<logger name="jdbc.connection" level="FATAL" additivity="false">
			<AppenderRef ref="console" />
			<AppenderRef ref="sqlErrorDailyRollingFile" />
		</logger>
		<logger name="jdbc.sqlonly" level="OFF" additivity="false">
			<AppenderRef ref="console" />
			<AppenderRef ref="sqlDailyRollingFile" />
		</logger>
		<logger name="jdbc.sqltiming" level="INFO" additivity="false">
			<AppenderRef ref="console" />
			<AppenderRef ref="sqlErrorDailyRollingFile" />
		</logger>
		<logger name="jdbc.audit" level="FATAL" additivity="false">
			<AppenderRef ref="console" />
			<AppenderRef ref="sqlErrorDailyRollingFile" />
		</logger>
		<logger name="jdbc.resultset" level="FATAL" additivity="false">
			<AppenderRef ref="console" />
			<AppenderRef ref="sqlErrorDailyRollingFile" />
		</logger>
	</Loggers>
</Configuration>
