More of converting log4net to Microsoft.Extensions.Logging.
Added a reference to the IServiceProvider into OpenSimServer which is the base class created by each of the services. In the individual modules, I've added a
private static ILogger? m_logger
to replace the static initialization with log4net. Then created a logger instance in the constructor/initializer so the classes begin with a
m_logger ??= OpenSimServer.Instance.ServiceProvider.GetRequiredService<ILogger>();
Then replaced all the references to m_log to m_logger and the proper method
So, if the individual class is ever DI'ed, that initial assignment would be replaced with the logger passed in by DI.
More of converting log4net to Microsoft.Extensions.Logging. Added a reference to the IServiceProvider into OpenSimServer which is the base class created by each of the services. In the individual modules, I've added a private static ILogger? m_logger to replace the static initialization with log4net. Then created a logger instance in the constructor/initializer so the classes begin with a m_logger ??= OpenSimServer.Instance.ServiceProvider.GetRequiredService<ILogger>();
Then replaced all the references to m_log to m_logger and the proper method
So, if the individual class is ever DI'ed, that initial assignment would be replaced with the logger passed in by DI.