2
我已經變成我的web.config日誌我使用log4net的用於記錄目的,但它不是寫
我使用.NET 4.0
我使用log4net的我已經添加了參考
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
</configSections>
<log4net debug="true">
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="C:\Users\n.gupta\Desktop\CacheService.log"/>
<appenToFile value="true" />
<rollingStyle value="Size"/>
<maxsixeRollBackups value="10"/>
<maximumFileSize value="10Mb"/>
<staticLogFileName value="true"/>
<layout type="log4net.PatternLayout">
<conversionPattern value="%-5p %d %5rms %-22.22c{1} %-18.18M - %m%n"/>
</layout>
</appender>
<root>
<level value="DEBUG"/>
<appender-ref ref="RollingLogFileAppender" />
</root>
</log4net>
中的AssemblyInfo.cs我已經更改
[assembly:log4net.Config.XmlConfigurator(ConfigFile="Web.config",Watch=true)]
我有添加調試到我的控制器
我有貨控制器,它包含了創建方法whihc我正在登錄
public class ShipmentController : BaseController
{
private static readonly ILog logger = ogManager.GetLogger(typeof(ShipmentController));
public ActionResult ShipmentCreation()
{
//I have attached the debug code for the message
logger.Debug("Hello I am in Shipment creation Method");
}
}
正在創建的文件,但它在不附加任何