开发者

Can I get a Logger by specifying a file that contains a log4net configuration?

For example, like

LogManag开发者_StackOverflower.GetLogger("C:\myloggerconfig.xml", "MyLoggerName");


The simplest way is to drop the following code into your AssemblyInfo.cs file:

[assembly: log4net.Config.XmlConfigurator(ConfigFile="c:\\myloggerconfig.xml",Watch=true)]

You can also do it programatically:

XmlConfigurator.Configure(new System.IO.FileInfo("c:\\myloggerconfig.xml");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜