Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
たとえば、
LogManager.GetLogger("C:\myloggerconfig.xml", "MyLoggerName");
最も簡単な方法は、次のコードをAssemblyInfo.csファイルにドロップすることです。
AssemblyInfo.cs
[assembly: log4net.Config.XmlConfigurator(ConfigFile="c:\\myloggerconfig.xml",Watch=true)]
プログラムで行うこともできます。
XmlConfigurator.Configure(new System.IO.FileInfo("c:\\myloggerconfig.xml");