<?xml version="1.0" encoding="UTF-8" ?>
<configuration scan="true" scanPeriod="10 seconds">
	<property name="LOG_PATTERN" value="[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] \\(%F:%L\\) %-20M -%msg%n" />
	<property name="PREFIX" value="${inst.Type:-ems}" />
	<property name="LOG_HOME" value="/Log/App/eapim/${inst.Name:-devSvr00}" />
	<property name="BACKUP_HOME" value="${LOG_HOME}/backup/" />
	<property name="LOG_LEVEL" value="${LOGBACK_LOG_LEVEL:-INFO}" />

	<appender name="STDOUT"
		class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${LOG_HOME}/${PREFIX}_stdout.log</file>
		<rollingPolicy
			class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>
				${LOG_HOME}/${PREFIX}_stdout.log-%d{yyyy-MM-dd}
			</fileNamePattern>
			<maxHistory>10</maxHistory>
		</rollingPolicy>
	</appender>

	<appender name="ACCESS_APPENDER"
		class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${LOG_HOME}/${PREFIX}_access.log</file>
		<rollingPolicy
			class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>
				${LOG_HOME}/${PREFIX}_access.log-%d{yyyy-MM-dd}
			</fileNamePattern>
		</rollingPolicy>
	</appender>
	<appender name="SMS_APPENDER"
		class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${LOG_HOME}/sms.log</file>
		<rollingPolicy
			class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>
				${LOG_HOME}/sms.log-%d{yyyy-MM-dd}
			</fileNamePattern>
			<maxHistory>10</maxHistory>
		</rollingPolicy>
	</appender>
	<appender name="QUERY_APPENDER"
		class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${LOG_HOME}/${PREFIX}_query.log</file>
		<rollingPolicy
			class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>
				${LOG_HOME}/${PREFIX}_query.log-%d{yyyy-MM-dd}
			</fileNamePattern>
			<maxHistory>10</maxHistory>
		</rollingPolicy>
	</appender>
	<appender name="DYNAMIC_APPENDER"
		class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${LOG_HOME}/${PREFIX}_dynamic.log</file>
		<rollingPolicy
			class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>
				${LOG_HOME}/${PREFIX}_dynamic.log-%d{yyyy-MM-dd}
			</fileNamePattern>
			<maxHistory>10</maxHistory>
		</rollingPolicy>
	</appender>
	
	<logger name="com.eactive.eai.rms.onl.server" level="${LOG_LEVEL}" />
	<logger name="com.eactive.eai.rms.onl.dashboard" level="${LOG_LEVEL}" />
	<logger name="com.eactive.eai.rms.common.acl.user.BizDao" level="${LOG_LEVEL}" />
	
	<logger name="org.springframework" level="${LOG_LEVEL}" />
	
	
	

	<logger name="ACCESS_LOGGER" level="${LOG_LEVEL}" >
		<appender-ref ref="ACCESS_APPENDER" />
	</logger>
	<logger name="SMS_LOGGER" level="${LOG_LEVEL}" >
		<appender-ref ref="SMS_APPENDER" />
	</logger>
	<logger name="DYNAMIC_LOGGER" level="${LOG_LEVEL}" >
		<appender-ref ref="DYNAMIC_APPENDER" />
	</logger>


<!-- QUERY_APPENDER start -->
	<logger name="java.sql" level="${LOG_LEVEL}" additivity="false">
		<appender-ref ref="QUERY_APPENDER" />
	</logger>
	<logger name="com.ibatis" level="${LOG_LEVEL}"  additivity="false">
		<appender-ref ref="QUERY_APPENDER" />
	</logger>
	<logger name="com.ibatis.common.jdbc.SimpleDataSource"	level="${LOG_LEVEL}" additivity="false">
		<appender-ref ref="QUERY_APPENDER" />
	</logger>
	<logger name="com.ibatis.common.jdbc.ScriptRunner" level="${LOG_LEVEL}" additivity="false">
		<appender-ref ref="QUERY_APPENDER" />
	</logger>
	<logger name="com.ibatis.common.jdbc.logging" level="${LOG_LEVEL}" additivity="false">
		<appender-ref ref="QUERY_APPENDER" />
	</logger>
	<logger	name="com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate" level="${LOG_LEVEL}" additivity="false">
		<appender-ref ref="QUERY_APPENDER" />
	</logger>
	<logger name="java.sql.Connection" level="${LOG_LEVEL}" additivity="false">
		<appender-ref ref="QUERY_APPENDER" />
	</logger>
	<logger name="java.sql.Statement" level="${LOG_LEVEL}" additivity="false">
		<appender-ref ref="QUERY_APPENDER" />
	</logger>
	<logger name="java.sql.PreparedStatement" level="${LOG_LEVEL}" additivity="false">
		<appender-ref ref="QUERY_APPENDER" />
	</logger>
	<logger name="java.sql.ResultSet" level="${LOG_LEVEL}" additivity="false">
		<appender-ref ref="QUERY_APPENDER" />
	</logger>
	<logger name="com.eactive.eai.rms.common.base.SchemaIdConfiguredSqlMapTemplate" level="${LOG_LEVEL}" additivity="false">
		<appender-ref ref="QUERY_APPENDER" />
	</logger>	
	<logger name="com.ibatis.sqlmap.engine.builder.xml.XMLSqlSource.parseDynamicTags" level="${LOG_LEVEL}" additivity="false">
		<appender-ref ref="QUERY_APPENDER" />
	</logger>	
	<logger name="com.ibatis.common.xml.NodeletParser" level="${LOG_LEVEL}" additivity="false">
		<appender-ref ref="QUERY_APPENDER" />
	</logger>
	<logger name="java.util.StringTokenizer.nextToken" level="${LOG_LEVEL}" additivity="false">
		<appender-ref ref="QUERY_APPENDER" />
	</logger>	

<!-- QUERY_APPENDER end -->


	<root>
		<level value="${LOG_LEVEL}" />
		<appender-ref ref="STDOUT" />
	</root>
</configuration>