English 中文(简体)
网上窗口应用中的标识4net
原标题:Using log4net in .net windows application

我们正在使用标志4Net,将信息输入我们的网络3.5窗口应用程序的文档和数据库。

The winforms application is deployed on to production environment and is up and running. Before the deployment, the level node attribute value is set to "ALL".

<level value="ALL"/>

While the application is running, I need to change the level to say "ERROR" and save the xml.And then, the log4net should log only "error" type messages in the log. How do i achieve this using log4net? If not feasible,any other approach please?

感谢。

最佳回答

否则,如果你将日元组合单独存档(而不是在笔录中),你就可以更新这一档案,而申请将立即改变由于日志4net的XmlConfigurator的信息量。

如果你想在你的申请范围内动态地更新伐木水平,那么,由于林研中心到XML的能力,从Net 3.5+,就能够这样做。 I ve written a blog post listed how to do that here

问题回答

Using

[assembly: log4net.Config.XmlConfigurator(Watch=true)]

可在 rel=“nofollow”上查阅。

在申请中,你需要在汇簿上安装一个档案监视器,然后重新启用关于改用汇文档的标志4net。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签