<configuration scan="true" scanPeriod=" 5 seconds">
	<jmxConfigurator />
	<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
		<encoder>
			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{56} - %msg%n
			</pattern>
		</encoder>
	</appender>

	<appender name="CANAL-ROOT" class="ch.qos.logback.classic.sift.SiftingAppender">
        <discriminator>
            <Key>adapter</Key>
            <DefaultValue>adapter</DefaultValue>
        </discriminator>
		<sift>
			<appender name="FILE-adapter" class="ch.qos.logback.core.rolling.RollingFileAppender">
				<File>../logs/adapter/adapter.log</File>
				<rollingPolicy
						class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
					<!-- rollover daily -->
					<fileNamePattern>../logs/adapter/%d{yyyy-MM-dd}/adapter-%d{yyyy-MM-dd}-%i.log.gz</fileNamePattern>
					<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
						<!-- or whenever the file size reaches 100MB -->
						<maxFileSize>512MB</maxFileSize>
					</timeBasedFileNamingAndTriggeringPolicy>
					<maxHistory>60</maxHistory>
				</rollingPolicy>
				<encoder>
					<pattern>
						%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{56} - %msg%n
					</pattern>
				</encoder>
			</appender>
		</sift>
	</appender>

	<logger name="com.alibaba.otter.canal.client.adapter.hbase" additivity="false">
		<level value="DEBUG" />
		<appender-ref ref="STDOUT"/>
		<appender-ref ref="CANAL-ROOT" />
	</logger>
	<logger name="com.alibaba.otter.canal.client.adapter.es" additivity="false">
		<level value="DEBUG" />
		<appender-ref ref="STDOUT"/>
		<appender-ref ref="CANAL-ROOT" />
	</logger>
	<logger name="com.alibaba.otter.canal.client.adapter.rdb" additivity="false">
		<level value="DEBUG" />
		<appender-ref ref="STDOUT"/>
		<appender-ref ref="CANAL-ROOT" />
	</logger>
	<logger name="com.alibaba.otter.canal.client.adapter.logger" additivity="false">
		<level value="DEBUG" />
		<appender-ref ref="STDOUT"/>
		<appender-ref ref="CANAL-ROOT" />
	</logger>

	<root level="INFO">
		<appender-ref ref="STDOUT"/>
		<appender-ref ref="CANAL-ROOT" />
	</root>
</configuration>
