Dynamic Watch Log4net Configure fix Watching Failed Problem
来源:互联网 发布:java定义json字符串 编辑:程序博客网 时间:2024/05/14 02:56
Problem:
Using Log4net to output logs.
After the configure file is ready, we will add its reference to Project's AssemblyInfo.cs like this:
Log4net.Configure.XMLConfigure( Configure = File, Watch = True);
Then, Initial a logger by Log4Net.ILog.
If all are ready, we can use it for logging.
But, after i change Configre File's name and reset the info in Assembly.cs, log cannot be write again.
I have try many times, even simple the code and info in configuration.
None of them works.
Finally, the "Dynamic Watch" Help it.
Solution:
Abandon original watching approach. Do like this:
Add code before Logger instantiate:
FileInfo configureFileinfo = new Fileinfo( string fullpath of ConfigureFile);
Log4net.Config.XmlConfigurator.ConfigureAndWatch( configureFileinfo );
- Dynamic Watch Log4net Configure fix Watching Failed Problem
- Cisco dynamic VPN configure!
- How to configure the log4net
- How to fix the problem of executing gitenv.csh file failed
- Dynamic log fileNames with log4net
- mysql connection problem fix
- fix ffmpeg build problem
- Fix the Problem with MergeList
- How to fix oozie problem
- PPTPD centos7 install problem fix
- zmq: dynamic discovery problem
- Dynamic Programming Solvable Problem
- Dynamic programming - LSC problem
- dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem. E: _cache->open() failed, please repo
- Fix failed to start session in Ubuntu
- codeforces D. Dynamic Problem Scoring
- Flash 8 Video Encoder installation fix ...problem
- fix graphviz install problem in macbook
- POJ 1146 ID Codes
- Android 设置页面的设计
- js try..catch 的复习
- 自动锁
- worldwind C#版
- Dynamic Watch Log4net Configure fix Watching Failed Problem
- Qt Tooltip详解
- CentOs添加yum源的地址
- 实现gwt rpc tomcat 下debug 和develop module debug,让jettry and tomcat 识别servlet
- socket阻塞和非阻塞的区别
- smarty 总结
- Linux 命令 ctags使用详解
- Sql查询字符串的位置
- IOS可以拖动的UIButton