日期:2014-05-17 浏览次数:21467 次
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<!--Log设定-->
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net-net-1.0" />
</configSections>
<log4net>
<!--日志记录器logger,可以有多个-->
<logger name="fileLog">
<level value="ALL" />
<appender-ref ref="ConsoleAppender" />
<!--<appender-ref ref="LogFileAppender" />-->
<appender-ref ref="RollingLogFileAppender" />
</logger>
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender" >
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n"/>
</layout>
</appender>
<!--<appender name="LogFileAppender" type="log4net.Appender.FileAppender" >
<param name="File" value="logRaifuRFID.txt" />
<param name="AppendToFile" value="true" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n" />
</layout>
</appender>-->
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log"/>
<param name="AppendToFile" value="true"/>
<param name="MaxSizeRollBackups" value="10"/>
<param name="StaticLogFileName" value="false"/>
<param name="DatePattern" value="yyyyMMdd".log""/>
<param name="RollingStyle" value="Date"/>
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n%n"/>
</layout>
</appender>
</log4net>
</configuration>