<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="10 seconds">

	<property name="LOG_HOME" value="/mdata/cooleshow-test/jenkins/logs/gateway-%d{yyyy-MM-dd_HH}-%i.log" />
	<property name="CONSOLE_LOG_PATTERN"
		value="[%X{username} %X{ip} %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36}] : %msg%n" />

	<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
		<encoder charset="UTF-8">
			<pattern>${CONSOLE_LOG_PATTERN}</pattern>
		</encoder>
	</appender>

	<appender name="file"
		class="ch.qos.logback.core.rolling.RollingFileAppender">
		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<FileNamePattern>${LOG_HOME}</FileNamePattern>
			<MaxHistory>90</MaxHistory>
			<TimeBasedFileNamingAndTriggeringPolicy
				class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
				<MaxFileSize>20MB</MaxFileSize>
			</TimeBasedFileNamingAndTriggeringPolicy>
		</rollingPolicy>

		<encoder>
			<pattern>${CONSOLE_LOG_PATTERN}</pattern>
		</encoder>
	</appender>

	<logger name="com.yonge" level="ERROR" />
	<root level="ERROR">
		<appender-ref ref="stdout" />
		<appender-ref ref="file" />
	</root>

</configuration>