????1??Log4net??????????????????????????????????????????????C#???????????C# MVCWeb?????????????????
???????????????μ??
????2?????????????????????????Log4net.dll    --???NuGet

????3???????Щ???????????App.config???????????????????App.config?????????????????????У?????????→??ó????????????????????
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler?? log4net" />
</configSections>
<log4net>
<root>
<level value="ALL" />
<appender-ref ref="SysAppender" />
</root>
<logger name="WebLogger">
<level value="DEBUG" />
</logger>
<appender name="SysAppender" type="log4net.Appender.RollingFileAppender??log4net">
<!--<param name="File" value="App_Data/" />-->
<param name="File" value="C:\TestWeb\Debug\Error\" />
<param name="AppendToFile" value="true" />
<param name="RollingStyle" value="Date" />
<param name="DatePattern" value=""Logs_"yyyyMMdd".txt"" />
<param name="StaticLogFileName" value="false" />
<layout type="log4net.Layout.PatternLayout??log4net">
<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
<param name="Header" value=" ----------------------header--------------------------
" />
<param name="Footer" value=" ----------------------footer--------------------------
" />
</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>
</log4net>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework??Version=v4.5" />
</startup>
</configuration>
?????????????????
??????1?? ???ó????
????<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler?? log4net" />
??????2?? ????????д??????????
????????  ?????????????????????????????????????????????????????????????????????
????4????AssemblyInfo.cs???????仰

????[assembly: log4net.Config.XmlConfigurator(ConfigFileExtension = "config"?? Watch = true)]
??????MVC ?????????  Global.asax.cs???

????5??????????????д????????
static void Main(string[] args)
{
//log4net???
log4net.ILog logInfo = log4net.LogManager.GetLogger("loginfo");
logInfo.Info("???????д??");
}
????Ч??????????