<log4net>
	<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
		<!--定义文件存放位置-->
		<file value="log/" />
		<appendToFile value="true" />
		<rollingStyle value="Date" />
		<datePattern value="yyyyMMdd'.txt'" />
		<staticLogFileName value="false" />
		<param name="MaxSizeRollBackups" value="100" />
		<filter type="log4net.Filter.LevelRangeFilter">
			<levelMin value="ERROR" />
		</filter>
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
		</layout>
	</appender>

	<!--<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">-->
	<appender name="ConsoleAppender" type="log4net.Appender.ManagedColoredConsoleAppender">
		<target value="Console.Out"></target>
		<mapping>
			<level value="INFO"/>
			<foreColor value="GREEN"/>
		</mapping>
		<mapping>
			<level value="DEBUG"/>
			<foreColor value="BLUE"/>
		</mapping>
		<mapping>
			<level value="WARN"/>
			<foreColor value="YELLOW"/>
		</mapping>
		<mapping>
			<level value="ERROR"/>
			<foreColor value="Red"/>
		</mapping>
		<mapping>
			<level value="ERROR"/>
			<foreColor value="Red"/>
		</mapping>
		<mapping>
			<level value="ERROR"/>
			<foreColor value="Red"/>
		</mapping>
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="【时间】%date %n【线程】[%thread] %n【级别】%-5level %n【相关】%logger property: [%property{NDC}] - %n【描述】%message%newline %n%newline"/>
		</layout>

		<!--<layout type="log4net.Layout.PatternLayout" value="%date [%thread] %-5level %logger - %message%newline" />-->
	</appender>
	<root>
		<level value="ALL" />
		<appender-ref ref="ConsoleAppender" />
		<!--文件形式记录日志-->
		<appender-ref ref="RollingLogFileAppender" />
	</root>
</log4net>