您的位置:首页 > 其它

Log4NEt 配置

2016-07-04 13:57 239 查看
一:引入Log4NET.dll

二:在AssemblyInfo.Cs中加入[assembly: log4net.Config.XmlConfigurator(Watch = true)]

       

 

三:在配置文档里面配置一下,比如控制台的APP.config

四: log4net.GlobalContext.Properties["LogDir"] = currentTime.ToString("yyyyMM");

         log4net.GlobalContext.Properties["LogFileName"] = "_SocketAsyncServer" + currentTime.ToString("yyyyMMdd");

         Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: