1、官网URL: http://logging.apache.org/log4net/
2、配置文件参照URL: http://logging.apache.org/log4net/release/config-examples.html
3、在Web.config中加入以下代码
3.1:在configSections中加入
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
<configSections> <!--Log4net的配置--> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> </configSections>