<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>

	<appender name="COLLECTOR" class="org.apache.log4j.RollingFileAppender">
		<param name="File" value="${log.dir.path}collector.log" />
		<param name="MaxFileSize" value="10MB" />
		<param name="MaxBackupIndex" value="2" />
		<param name="Append" value="false" />

		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern" value="%d{MM-dd/HH:mm:ss} %5p [%t] %c{1} - %m%n" />
		</layout>

		<filter class="ru.bitel.common.logging.Log4JMDCFilter">
			<param name="key" value="nestedContext" />
			<param name="value" value="collector" />
		</filter>
	</appender>

	<appender name="LISTENER" class="org.apache.log4j.RollingFileAppender">
		<param name="File" value="${log.dir.path}loader.log" />
		<param name="MaxFileSize" value="10MB" />
		<param name="MaxBackupIndex" value="2" />
		<param name="Append" value="false" />

		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern" value="%d{MM-dd/HH:mm:ss} %5p [%t] %c{1} - %m%n" />
		</layout>

		<filter class="ru.bitel.common.logging.Log4JMDCFilter">
			<param name="key" value="nestedContext" />
			<param name="value" value="flowListener" />
		</filter>
	</appender>

	<appender name="DATALOADER" class="org.apache.log4j.RollingFileAppender">
		<param name="File" value="${log.dir.path}dataloader.log" />
		<param name="MaxFileSize" value="10MB" />
		<param name="MaxBackupIndex" value="2" />
		<param name="Append" value="false" />

		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern" value="%d{MM-dd/HH:mm:ss} %5p [%t] %c{1} - %m%n" />
		</layout>

		<filter class="ru.bitel.common.logging.Log4JMDCFilter">
			<param name="key" value="nestedContext" />
			<param name="value" value="dataloader" />
		</filter>
	</appender>

	<appender name="GENERATOR" class="org.apache.log4j.RollingFileAppender">
		<param name="File" value="${log.dir.path}generator.log" />
		<param name="MaxFileSize" value="10MB" />
		<param name="MaxBackupIndex" value="2" />
		<param name="Append" value="false" />

		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern" value="%d{MM-dd/HH:mm:ss} %5p [%t] %c{1} - %m%n" />
		</layout>

		<filter class="ru.bitel.common.logging.Log4JMDCFilter">
			<param name="key" value="nestedContext" />
			<param name="value" value="taskGenerator" />
		</filter>
	</appender>

	<appender name="DETAIL" class="org.apache.log4j.RollingFileAppender">
		<param name="File" value="${log.dir.path}detail.log" />
		<param name="MaxFileSize" value="10MB" />
		<param name="MaxBackupIndex" value="2" />
		<param name="Append" value="false" />

		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern" value="%d{MM-dd/HH:mm:ss} %5p [%t] %c{1} - %m%n" />
		</layout>

		<filter class="ru.bitel.common.logging.Log4JMDCFilter">
			<param name="key" value="nestedContext" />
			<param name="value" value="detail" />
		</filter>
	</appender>

	<appender name="ERROR" class="org.apache.log4j.RollingFileAppender">
		<param name="Threshold" value="ERROR" />
		<param name="File" value="${log.dir.path}error.log" />
		<param name="MaxFileSize" value="10MB" />
		<param name="MaxBackupIndex" value="2" />
		<param name="Append" value="false" />

		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern" value="%X{nestedContext} %d{MM-dd/HH:mm:ss} %5p [%t] %c{1} - %m%n" />
		</layout>
	</appender>

	<appender name="ASYNC" class="ru.bitel.common.logging.Log4jAsyncAppender">
		<appender-ref ref="COLLECTOR" />
		<appender-ref ref="LISTENER" />
		<appender-ref ref="DATALOADER" />
		<appender-ref ref="GENERATOR" />
		<appender-ref ref="DETAIL" />
		<appender-ref ref="ERROR" />
	</appender>

	<root>
		<priority value="INFO" />
		<appender-ref ref="ASYNC" />
	</root>

</log4j:configuration>
