いくつかのアプリケーションがあり、log4net をベースとするクラス ライブラリ MyLogger への参照を追加したいと考えています。このライブラリには App.config ファイルがあります。
したがって、この1つのプロジェクト/ライブラリにのみ構成ファイルが必要です。
だから、これは私のアプリケーションの方法です
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");
}
}
これを修正して、すべてを機能させるにはどうすればよいですか?