I am confused right now and may not understand the real problem.
I have an object that requires a registrar instance to log error data.
eg
public class CommonFileSaver : IFileSaver { private static ILog _log = LogManager.GetLogger(); ..... }
I want to check the logging process. And my current division is to use the ILog interface layout.
At this point, I decided to use Unity to resolve dependencies.
So the line
ILog _log = LogManager.GetLogger();
will look something like this:
ILog _log = Resolver.Instance.Resolve<ILoger>();
The question is how to configure the Unity container to return a new instance of the ILog object to me using the LogManager factory.
Thanks.
PS ILog is the log4net interface, and all logging is done using log4net right now.
source share