我有幾個應用程序,我想添加到他們對我的類庫MyLogger的引用,它基於log4net。在這個庫中我有App.config文件。使用log4net引用配置項目
所以我只想在這個項目/庫中的配置文件。
所以,這是方法在我的應用程序
public void TestMyLogger()
{
MyLogger myLogger=new MyLogger();
}
,這是MyLogger:
public class MyLogger
{
public MyLogger()
{
log4net.Config.XmlConfigurator.Configure();
Log.Fatal("this is a fatal msg");
Log.Error("this is an error msg");
Log.Warn("this is a warn msg");
Log.Info("this is an info msg");
Log.Debug("this is a debug msg");
}
}
如何解決這個問題,有一切工作?