log4net/README.md

1.6 KiB

Build status License NuGet NuGet

log4net adapter for Unity container

Unity extension to integrate with popular log4net logger.

Getting Started

  • Reference the Unity.log4net package from NuGet.
Install-Package Unity.log4net

Registration

  • 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...

Code of Conduct

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

Contributing

See the Contributing guide for more information.

.NET Foundation

Unity Container is a .NET Foundation project