Unity extension to integrate with popular log4net logger.
- Reference the
Unity.log4net
package from NuGet.
Install-Package Unity.log4net
- Add
Log4NetExtension
extension to the container
container = new UnityContainer();
container.AddNewExtension<Log4NetExtension>();
- Where required add
ILog
interface to resolved constructor.
public class LoggedType
{
public LoggedType(ILog log)
{
}
...
}
- Log normally...
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information, see the .NET Foundation Code of Conduct
See the Contributing guide for more information.
Unity Container is a .NET Foundation project