<configuration scan="false" scanPeriod="10 seconds"
	debug="true">
	<property resource="logback.properties" />

	<contextName>${context.name}</contextName>                         <!-- 本项目的名字 -->

	<appender name="console"
		class="ch.qos.logback.core.ConsoleAppender">
		<encoder>
			<pattern>${conversion.pattern}</pattern>
		</encoder>
	</appender>

	<!-- root file 日志 -->
	<appender name="root-file-all"
		class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${log.dir}/all.log</file>
		<rollingPolicy
			class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>${log.dir}/all.%d{${rolling.policy.file.name.pattern}}.%i.log.zip
			</fileNamePattern>
			<timeBasedFileNamingAndTriggeringPolicy
				class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
				<maxFileSize>${max.file.size}</maxFileSize>
			</timeBasedFileNamingAndTriggeringPolicy>
			<maxHistory>${max.history}</maxHistory>
		</rollingPolicy>
		<encoder>
			<pattern>${conversion.pattern}</pattern>
		</encoder>
	</appender>

	<appender name="root-file-error"
		class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${log.dir}/error.log</file>
		<rollingPolicy
			class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>${log.dir}/error.%d{${rolling.policy.file.name.pattern}}.%i.log.zip
			</fileNamePattern>
			<timeBasedFileNamingAndTriggeringPolicy
				class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
				<maxFileSize>${max.file.size}</maxFileSize>
			</timeBasedFileNamingAndTriggeringPolicy>
			<maxHistory>${max.history}</maxHistory>
		</rollingPolicy>
		<encoder>
			<pattern>${conversion.pattern}</pattern>
		</encoder>
		<filter class="ch.qos.logback.classic.filter.LevelFilter">
			<level>ERROR</level>
			<onMatch>ACCEPT</onMatch>
			<onMismatch>DENY</onMismatch>
		</filter>
	</appender>
	<appender name="root-file-warn"
		class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${log.dir}/warn.log</file>
		<rollingPolicy
			class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>${log.dir}/warn.%d{${rolling.policy.file.name.pattern}}.%i.log.zip
			</fileNamePattern>
			<timeBasedFileNamingAndTriggeringPolicy
				class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
				<maxFileSize>${max.file.size}</maxFileSize>
			</timeBasedFileNamingAndTriggeringPolicy>
			<maxHistory>${max.history}</maxHistory>
		</rollingPolicy>
		<encoder>
			<pattern>${conversion.pattern}</pattern>
		</encoder>
		<filter class="ch.qos.logback.classic.filter.LevelFilter">
			<level>warn</level>
			<onMatch>ACCEPT</onMatch>
			<onMismatch>DENY</onMismatch>
		</filter>
	</appender>
	<appender name="root-file-info"
		class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${log.dir}/info.log</file>
		<rollingPolicy
			class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>${log.dir}/info.%d{${rolling.policy.file.name.pattern}}.%i.log.zip
			</fileNamePattern>
			<timeBasedFileNamingAndTriggeringPolicy
				class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
				<maxFileSize>${max.file.size}</maxFileSize>
			</timeBasedFileNamingAndTriggeringPolicy>
			<maxHistory>${max.history}</maxHistory>
		</rollingPolicy>
		<encoder>
			<pattern>${conversion.pattern}</pattern>
		</encoder>
		<filter class="ch.qos.logback.classic.filter.LevelFilter">
			<level>INFO</level>
			<onMatch>ACCEPT</onMatch>
			<onMismatch>DENY</onMismatch>
		</filter>
	</appender>
	<appender name="root-file-debug"
		class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${log.dir}/debug.log</file>
		<rollingPolicy
			class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>${log.dir}/debug.%d{${rolling.policy.file.name.pattern}}.%i.log.zip
			</fileNamePattern>
			<timeBasedFileNamingAndTriggeringPolicy
				class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
				<maxFileSize>${max.file.size}</maxFileSize>
			</timeBasedFileNamingAndTriggeringPolicy>
			<maxHistory>${max.history}</maxHistory>
		</rollingPolicy>
		<encoder>
			<pattern>${conversion.pattern}</pattern>
		</encoder>
		<filter class="ch.qos.logback.classic.filter.LevelFilter">
			<level>debug</level>
			<onMatch>ACCEPT</onMatch>
			<onMismatch>DENY</onMismatch>
		</filter>
	</appender>

	<root level="${root.level}">
		<appender-ref ref="root-file-all" />
		<appender-ref ref="root-file-error" />
		<appender-ref ref="root-file-warn" />
		<appender-ref ref="root-file-info" />
		<appender-ref ref="root-file-debug" />
		<appender-ref ref="console" />
	</root>

	<logger name="${app.package}" additivity="false">
		<level value="${app.level}" />
		<appender-ref ref="root-file-all" />
		<appender-ref ref="root-file-error" />
		<appender-ref ref="root-file-warn" />
		<appender-ref ref="root-file-info" />
		<appender-ref ref="root-file-debug" />
		<appender-ref ref="console" />
	</logger>

	<logger name="${tio.package}" additivity="false">
		<level value="${tio.level}" />
		<appender-ref ref="root-file-all" />
		<appender-ref ref="root-file-error" />
		<appender-ref ref="root-file-warn" />
		<appender-ref ref="root-file-info" />
		<appender-ref ref="root-file-debug" />
		<appender-ref ref="console" />
	</logger>


	<logger name="${tio.ssl.package}" additivity="false">
		<level value="${tio.ssl.level}" />
		<appender-ref ref="root-file-all" />
		<appender-ref ref="root-file-error" />
		<appender-ref ref="root-file-warn" />
		<appender-ref ref="root-file-info" />
		<appender-ref ref="root-file-debug" />
		<appender-ref ref="console" />
	</logger>



	<logger name="${js.compress.package}" additivity="false">
		<level value="${js.compress.level}" />
		<appender-ref ref="root-file-all" />
		<appender-ref ref="root-file-error" />
		<appender-ref ref="root-file-warn" />
		<appender-ref ref="root-file-info" />
		<appender-ref ref="root-file-debug" />
		<appender-ref ref="console" />
	</logger>






	<!-- coinLog 日志 -->
	<appender name="coin-log-appender"
		class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${log.dir}/coin.log</file>
		<rollingPolicy
			class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>${log.dir}/coin.%d{yyyy-MM-dd}.%i.log.zip
			</fileNamePattern>
			<timeBasedFileNamingAndTriggeringPolicy
				class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
				<maxFileSize>${max.file.size}</maxFileSize>
			</timeBasedFileNamingAndTriggeringPolicy>
			<maxHistory>${max.history}</maxHistory>
		</rollingPolicy>
		<encoder>
			<pattern>${conversion.pattern}</pattern>
		</encoder>
	</appender>
	<logger name="coinLog" additivity="false">
		<level value="${coin.level}" />
		<appender-ref ref="coin-log-appender" />
	</logger>

	<!-- sqlupdateLog 日志 -->
	<property name="sqlupdateFilename" value="sqlupdate" />
	<appender name="sqlupdate-log"
		class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${log.dir}/${sqlupdateFilename}.sql</file>
		<rollingPolicy
			class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>${log.dir}/${sqlupdateFilename}.%d{yyyy-MM-dd}.%i.sql.zip
			</fileNamePattern>
			<timeBasedFileNamingAndTriggeringPolicy
				class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
				<maxFileSize>${max.file.size}</maxFileSize>
			</timeBasedFileNamingAndTriggeringPolicy>
			<maxHistory>${max.history}</maxHistory>
		</rollingPolicy>
		<encoder>
			<pattern>${sql.conversion.pattern}</pattern>
		</encoder>
	</appender>
	<logger name="updatesqlLog" additivity="false">
		<level value="${sqlupdateLevel}" />
		<appender-ref ref="sqlupdate-log" />
	</logger>

	<!-- sqlqueryLog 日志 -->
	<property name="sqlqueryFilename" value="sqlquery" />
	<appender name="sqlquery-log"
		class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${log.dir}/${sqlqueryFilename}.sql</file>
		<rollingPolicy
			class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>${log.dir}/${sqlqueryFilename}.%d{yyyy-MM-dd}.%i.sql.zip
			</fileNamePattern>
			<timeBasedFileNamingAndTriggeringPolicy
				class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
				<maxFileSize>${max.file.size}</maxFileSize>
			</timeBasedFileNamingAndTriggeringPolicy>
			<maxHistory>${max.history}</maxHistory>
		</rollingPolicy>
		<encoder>
			<pattern>${sql.conversion.pattern}</pattern>
		</encoder>
	</appender>
	<logger name="querysqlLog" additivity="false">
		<level value="${sqlqueryLevel}" />
		<appender-ref ref="sqlquery-log" />
	</logger>

	<!-- sqlslowLog 日志 -->
	<property name="sqlslowFilename" value="sqlslow" />
	<appender name="sqlslow-log"
		class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${log.dir}/${sqlslowFilename}.sql</file>
		<rollingPolicy
			class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>${log.dir}/${sqlslowFilename}.%d{yyyy-MM-dd}.%i.sql.zip
			</fileNamePattern>
			<timeBasedFileNamingAndTriggeringPolicy
				class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
				<maxFileSize>${max.file.size}</maxFileSize>
			</timeBasedFileNamingAndTriggeringPolicy>
			<maxHistory>${max.history}</maxHistory>
		</rollingPolicy>
		<encoder>
			<pattern>${sql.conversion.pattern}</pattern>
		</encoder>
	</appender>
	<logger name="slowsqlLog" additivity="false">
		<level value="${sqlslowLevel}" />
		<appender-ref ref="sqlslow-log" />
	</logger>

	<!-- sqlerrorLog 日志 -->
	<property name="sqlerrorFilename" value="sqlerror" />
	<appender name="sqlerror-log"
		class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${log.dir}/${sqlerrorFilename}.sql</file>
		<rollingPolicy
			class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>${log.dir}/${sqlerrorFilename}.%d{yyyy-MM-dd}.%i.sql.zip
			</fileNamePattern>
			<timeBasedFileNamingAndTriggeringPolicy
				class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
				<maxFileSize>${max.file.size}</maxFileSize>
			</timeBasedFileNamingAndTriggeringPolicy>
			<maxHistory>${max.history}</maxHistory>
		</rollingPolicy>
		<encoder>
			<pattern>${sql.conversion.pattern}</pattern>
		</encoder>
	</appender>
	<logger name="errorsqlLog" additivity="false">
		<level value="${sqlerrorLevel}" />
		<appender-ref ref="sqlerror-log" />
	</logger>

		<!-- sqlbigresultLog 日志 -->
	<property name="sqlbigresultFilename" value="sqlbigresult" />
	<appender name="sqlbigresult-log"
		class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${log.dir}/${sqlbigresultFilename}.sql</file>
		<rollingPolicy
			class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>${log.dir}/${sqlbigresultFilename}.%d{yyyy-MM-dd}.%i.sql.zip
			</fileNamePattern>
			<timeBasedFileNamingAndTriggeringPolicy
				class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
				<maxFileSize>${max.file.size}</maxFileSize>
			</timeBasedFileNamingAndTriggeringPolicy>
			<maxHistory>${max.history}</maxHistory>
		</rollingPolicy>
		<encoder>
			<pattern>${sql.conversion.pattern}</pattern>
		</encoder>
	</appender>
	<logger name="bigresultsqlLog" additivity="false">
		<level value="${sqlbigresultLevel}" />
		<appender-ref ref="sqlbigresult-log" />
	</logger>

	<!-- tio集群日志级别 -->
	<logger name="${tio.clu.package}" additivity="false">
		<level value="${tio.clu.level}" />
		<appender-ref ref="root-file-all" />
		<appender-ref ref="root-file-error" />
		<appender-ref ref="root-file-warn" />
		<appender-ref ref="root-file-info" />
		<appender-ref ref="root-file-debug" />
		<appender-ref ref="console" />
	</logger>


</configuration>