1、引用log4net.dll(放到根目录中)
2、log4net.config文件
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
</configSections>
<log4net>
<appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
<!--日志目录-->
<file value="Logs/TokenBatchTest"/>
<param name="StaticLogFileName" vallue="false"/>
<appendToFile value="true"/>
<maximumFileSize value="5MB"/>
<lockingModel type="log4net.Appender.FileAppender+MinimalLock"/>
<maxSizeRollBackups value="40"/>
<!--日志文件命名规范,日志写在Logs文件夹下TokenBatchTest_2