https://github.com/unitycontainer/log4net
Unity adapter for log4net
https://github.com/unitycontainer/log4net
Last synced: 11 months ago
JSON representation
Unity adapter for log4net
- Host: GitHub
- URL: https://github.com/unitycontainer/log4net
- Owner: unitycontainer
- License: apache-2.0
- Created: 2018-01-09T14:04:39.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-07T15:45:59.000Z (about 3 years ago)
- Last Synced: 2025-03-20T15:04:21.255Z (12 months ago)
- Language: C#
- Size: 53.7 KB
- Stars: 17
- Watchers: 4
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
[](https://ci.appveyor.com/project/IoC-Unity/log4net/branch/v5.x)
[](https://github.com/IoC-Unity/log4net/blob/master/LICENSE)
[](https://www.nuget.org/packages/Unity.log4net)
[](https://www.nuget.org/packages/Unity.log4net)
# log4net adapter for Unity container
Unity extension to integrate with popular [log4net](https://github.com/apache/logging-log4net) logger.
## Getting Started
- Reference the `Unity.log4net` package from NuGet.
```shell
Install-Package Unity.log4net
```
## Registration
- Add `Log4NetExtension` extension to the container
```C#
container = new UnityContainer();
container.AddNewExtension();
```
- Where required add `ILog` interface to resolved constructor.
```C#
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](https://www.contributor-covenant.org/) to clarify expected behavior in our community. For more information, see the [.NET Foundation Code of Conduct](https://www.dotnetfoundation.org/code-of-conduct)
## Contributing
See the [Contributing guide](https://github.com/unitycontainer/unity/blob/master/CONTRIBUTING.md) for more information.
## .NET Foundation
Unity Container is a [.NET Foundation](https://dotnetfoundation.org/projects/unitycontainer) project