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);
二:在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);
相关文章推荐
- PL/SQL Developer如何连接64位的Oracle图解
- 结构体之offsetof宏详细解析
- 面试题16:链表逆序
- 4.盘点springmvc的常用接口之PropertyEditor
- 【Android Studio插件】Android Studio插件整理
- java list随机打乱
- 查看centos中的用户和用户组
- malloc and free
- JavaScript 兼容浏览器的部分问题的总结及解决方法
- linux 三剑客之 awk
- __declspec(dllexport)和__declspec(dllimport)
- centos 搭建dz论坛
- 编写第一个Hibernate例子思路
- StringBuffer字符串缓冲器
- java算法之二分查找
- 栈和队列 知识点
- Android Tab -- 使用ViewPager、PagerAdapter来实现
- 面试题11:数值的整数次方
- EJB
- iOS Assertion failure in -[UITableView _classicHeightForRowAtIndexPath:]