Hi
My main VB.NET application uses sets up and configures Log4Net. It calls two
or three other assemblies and I want to "pass a reference" to the main app's
Log4Net instance to those assemblies so they log messages into the same log
file and respect the same configuration settings. Is it correct to do this:
In the main app I have the following method call to my assembly:
SetLog(mLog.Logger.Repository)
Where "mLog" implements the ILog interface.
In the assembly the SetLog method is:
Public Sub SetLog(ByVal Repository As log4net.Repository.ILoggerRepository)
log4net.Config.BasicConfigurator.Configure(Repository)
mLog = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod
().DeclaringType)
End Sub
This seems to work OK but I'm unsure if it's a good thing to pass Repository's
between assemblies in this way.
Any and all advice would be appreciated.