{"id":18249563,"url":"https://github.com/unitycontainer/nlog","last_synced_at":"2025-08-10T23:38:37.743Z","repository":{"id":66232680,"uuid":"116823996","full_name":"unitycontainer/NLog","owner":"unitycontainer","description":"Adapter for NLog ","archived":false,"fork":false,"pushed_at":"2023-03-07T15:43:18.000Z","size":42,"stargazers_count":20,"open_issues_count":2,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-04T17:36:05.000Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unitycontainer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["ENikS"],"open_collective":"unity-container"}},"created_at":"2018-01-09T14:07:39.000Z","updated_at":"2023-12-05T05:18:23.000Z","dependencies_parsed_at":"2023-05-18T12:19:53.357Z","dependency_job_id":null,"html_url":"https://github.com/unitycontainer/NLog","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unitycontainer%2FNLog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unitycontainer%2FNLog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unitycontainer%2FNLog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unitycontainer%2FNLog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unitycontainer","download_url":"https://codeload.github.com/unitycontainer/NLog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223149534,"owners_count":17095951,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T09:40:31.470Z","updated_at":"2024-11-05T09:40:32.223Z","avatar_url":"https://github.com/unitycontainer.png","language":"C#","funding_links":["https://github.com/sponsors/ENikS","https://opencollective.com/unity-container"],"categories":[],"sub_categories":[],"readme":"[![Build status](https://ci.appveyor.com/api/projects/status/tr7ykk0g5jgieon2/branch/v5.x?svg=true)](https://ci.appveyor.com/project/unitycontainer/nlog-9y7y3/branch/v5.x)\n[![License](https://img.shields.io/badge/license-apache%202.0-60C060.svg)](https://github.com/IoC-Unity/NLog/blob/master/LICENSE)\n[![NuGet](https://img.shields.io/nuget/dt/Unity.NLog.svg)](https://www.nuget.org/packages/Unity.NLog)\n[![NuGet](https://img.shields.io/nuget/v/Unity.NLog.svg)](https://www.nuget.org/packages/Unity.NLog)\n\n# NLog adapter for Unity container\n\nUnity extension to integrate with popular [NLog](https://github.com/nlog/nlog) logger.\n\n## Getting Started\n\n- Reference the `Unity.NLog` package from NuGet.\n\n```shell\nInstall-Package Unity.NLog\n```\n\n## Registration:\n\n- Add `NLogExtension` extension to the container\n\n```C#\ncontainer = new UnityContainer();\ncontainer.AddNewExtension\u003cNLogExtension\u003e();\n```\n\n- Where required add `ILogger` interface to resolved constructor. \n\n```C#\npublic class LoggedType\n{\n    public LoggedType(ILogger log)\n    {\n    }\n  ...\n}\n```\n\n- If you want to custom the extension (In this case, get only the class name instead of the full name), you have to \ninstantiate NLogExtension to set properties and add this extension to Unity\n\n```C#\nvar ext = new NLogExtension{\n    GetName = (t, n) =\u003e t.Name\n};\ncontainer.AddExtension(ext);\n```\n\n- Log normally...\n\n## Code of Conduct\n\nThis 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)\n\n## Contributing\n\nSee the [Contributing guide](https://github.com/unitycontainer/unity/blob/master/CONTRIBUTING.md) for more information.\n\n## .NET Foundation\n\nUnity Container is a [.NET Foundation](https://dotnetfoundation.org/projects/unitycontainer) project\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funitycontainer%2Fnlog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funitycontainer%2Fnlog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funitycontainer%2Fnlog/lists"}