<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds"
	debug="false">
	<!-- 模块名称， 影响日志配置名，日志文件名 -->
	<property name="appName" value="busi-app-control" />
	<!-- 日志路径，这里是相对路径 -->
	<property name="rootPath" value="/logs" />

	<!-- contextName -->
	<contextName>${appName}</contextName>

	<!--格式化输出：%d表示日期，%thread表示线程名，%-5level：级别从左显示5个字符宽度%msg：日志消息，%n是换行符 -->
	<property name="LOG_PATTERN"
		value="%d{yyyy-MM-dd HH:mm:ss:SSS} [%thread] %-5level %logger{50} - %msg%n" />

	<!--控制台输出 -->
	<appender name="consoleAppender"
		class="ch.qos.logback.core.ConsoleAppender">
		<encoder>
			<pattern>${LOG_PATTERN}</pattern>
		</encoder>
	</appender>

	<appender name="fileAppender"
		class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${rootPath}/${appName}.log</file>
		<rollingPolicy
			class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
			<fileNamePattern>${rootPath}/${appName}.%i.log.zip</fileNamePattern>
			<minIndex>1</minIndex>
			<maxIndex>20</maxIndex>
		</rollingPolicy>
		<triggeringPolicy
			class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
			<maxFileSize>20MB</maxFileSize>
		</triggeringPolicy>
		<encoder>
			<pattern>${LOG_PATTERN}</pattern>
		</encoder>
	</appender>

	<logger name="com.huatek" level="debug" />

	<root level="warn">
		<appender-ref ref="fileAppender" />
		<appender-ref ref="consoleAppender" />
	</root>
</configuration>