log4net.config 1.27 KB
<?xml version="1.0"?>
<log4net>
	<root>
		<level value="DEBUG"/>
		<appender-ref ref="SysAppender"/>
		<appender-ref ref="consoleApp"/>
	</root>
	<!--信息日志配置-->
	<appender name="SysAppender" type="log4net.Appender.RollingFileAppender">
		<param name="File" value="Logs/" />
		<param name="AppendToFile" value="true" />
		<param name="MaximumFileSize" value="20MB" />
		<param name="MaxSizeRollBackups" value="100" />
		<param name="StaticLogFileName" value="false" />
		<param name="DatePattern" value="/yyyyMM/yyyyMMdd&quot;.log&quot;" />
		<param name="RollingStyle" value="Composite" />
		<layout type="log4net.Layout.PatternLayout">
			<param name="ConversionPattern" value="%n--------------------------------------------------------------------------------------%n日志时间:%d [%t] %n日志级别:%-5p %n日 志 类:%c [%x] %n%m %n" />
			<param name="Header" value="=============================================================================" />
		</layout>
	</appender>
	<appender name="consoleApp" type="log4net.Appender.ConsoleAppender,log4net">
		<layout type="log4net.Layout.PatternLayout,log4net">
			<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
		</layout>
	</appender>
	<logger name="WebLogger">
		<level value="DEBUG"/>
	</logger>

</log4net>