<?xml version="1.0" encoding="UTF-8"?>
<configuration>

	<property name="ARTHAS_LOG_PATH"
		value="${ARTHAS_LOG_PATH:-${user.home}/logs/arthas}" />
	<property name="ARTHAS_LOG_FILE"
		value="${ARTHAS_LOG_FILE:-${ARTHAS_LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}}/arthas.log}" />

	<appender name="APPLICATION"
		class="com.alibaba.arthas.deps.ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${ARTHAS_LOG_FILE}</file>
		<encoder>
			<pattern>%date %level [%thread] %logger{10} [%file:%line] %msg%n
			</pattern>
		</encoder>
		<rollingPolicy
			class="com.alibaba.arthas.deps.ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
			<fileNamePattern>${ARTHAS_LOG_FILE}.%d{yyyy-MM-dd}.%i.log
			</fileNamePattern>
			<maxHistory>7</maxHistory>
			<maxFileSize>1MB</maxFileSize>
			<totalSizeCap>10MB</totalSizeCap>
		</rollingPolicy>
	</appender>

	<appender name="CONSOLE"
		class="com.alibaba.arthas.deps.ch.qos.logback.core.ConsoleAppender">
		<encoder>
			<pattern>${CONSOLE_LOG_PATTERN}</pattern>
			<charset>utf8</charset>
		</encoder>
	</appender>

	<root level="ERROR">
		<appender-ref ref="CONSOLE" />
		<appender-ref ref="APPLICATION" />
	</root>

</configuration>