I have a service application that on startup reads an XML file and starts a thread for each entry in the XML file. Each thread creates an instance of a worker class which re
I think I have worked out the issue. The steps follow:
ILoggerRepository object (loggerRepository in this example) on each thread.In return I get a new configured logger pointing to the respective file for that thread.
The XML configuration is the same as it was originally and shown here for completeness:
The code to create the loggers is below. Each time this code is run it is run in its own thread.
ILoggerRepository loggerRepository = LogManager.CreateRepository(logFileName + "Repository");
ThreadContext.Properties["LogName"] = logFileName;
log4net.Config.XmlConfigurator.Configure(loggerRepository);
ILog logger = LogManager.GetLogger(logFileName + "Repository", "ProductionLogger");
This seems to work with no issues so far. I will be moving forward with this solution for the moment but I will update this post if I find out anything else.