I have a single-threaded application that loads several assemblies at runtime using the following:
objDLL = Assembly.LoadFrom(strDLLs[i]);
I would like the assemblies loaded in this manner to use the same log4net.ILog reference as the rest of the assemblies do. But it appears the runtime loaded assemblies have a different reference altogether and need their own configuration. Does anyone know if a single log4net.ILog can be used across assemblies loaded at runtime using a .NET interface?
Here is the log4net.ILog creation and supporting code in the Program class:
// Configure log4net using the .config file
[assembly: log4net.Config.XmlConfigurator(Watch = true)]
public static class Program
{
private static log4net.ILog m_Log = null;
[STAThread]
public static void Main(string[] args)
{
try
{
m_Log = log4net.LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType);
}
}
}