Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/NLog.Extensions.Hosting/NLog.Extensions.Hosting.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@

For ASP.NET Core, check: https://www.nuget.org/packages/NLog.Web.AspNetCore
</Description>
<PackageProjectUrl>https://github.com/NLog/NLog.Extensions.Logging</PackageProjectUrl>
<PackageLicenseExpression>BSD-2-Clause</PackageLicenseExpression>
<PackageIcon>N.png</PackageIcon>
<RepositoryUrl>https://github.com/NLog/NLog.Extensions.Logging.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>NLog;Microsoft.Extensions.Hosting;log;logging;logfiles;netcore</PackageTags>
<PackageReleaseNotes>
Full changelog: https://github.com/NLog/NLog.Extensions.Logging/blob/master/CHANGELOG.MD
Full changelog: https://github.com/NLog/NLog.Extensions.Logging/blob/master/CHANGELOG.MD
</PackageReleaseNotes>
<PackageProjectUrl>https://github.com/NLog/NLog.Extensions.Logging</PackageProjectUrl>
<RepositoryUrl>https://github.com/NLog/NLog.Extensions.Logging.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>BSD-2-Clause</PackageLicenseExpression>
<PackageIcon>N.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>

<!-- SonarQube needs ProjectGuid -->
<ProjectGuid>{548E65CE-0378-4812-AE00-B173F1251D3C}</ProjectGuid>
Expand Down Expand Up @@ -66,6 +67,7 @@ Full changelog: https://github.com/NLog/NLog.Extensions.Logging/blob/master/CHAN

<ItemGroup>
<None Include="N.png" Pack="true" PackagePath="" Visible="false" />
<None Include="README.md" Pack="true" PackagePath="" />
</ItemGroup>

<Target Name="DownloadMissingContent" BeforeTargets="GenerateNuspec">
Expand Down
38 changes: 38 additions & 0 deletions src/NLog.Extensions.Hosting/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# NLog.Extensions.Hosting

[![](https://sonarcloud.io/api/project_badges/measure?project=nlog.extensions.logging&branch=masterr&metric=reliability_rating)](https://sonarcloud.io/dashboard/?id=nlog.web&branch=master)
[![](https://sonarcloud.io/api/project_badges/measure?project=nlog.extensions.logging&branch=master&metric=sqale_rating)](https://sonarcloud.io/dashboard/?id=nlog.web&branch=master)
[![](https://sonarcloud.io/api/project_badges/measure?project=nlog.extensions.logging&branch=master&metric=vulnerabilities)](https://sonarcloud.io/dashboard/?id=nlog.web&branch=master)

Integrates NLog as Logging provider for Microsoft.Extensions.Logging, by just calling `UseNLog()` on the application-IHostBuilder.

Providing features like:

- Capture [structured message properties](https://github.com/NLog/NLog.Extensions.Logging/wiki/NLog-properties-with-Microsoft-Extension-Logging) from the [Microsoft ILogger](https://github.com/NLog/NLog.Extensions.Logging/wiki/NLog-GetCurrentClassLogger-and-Microsoft-ILogger)
- Capture scope context properties from the Microsoft ILogger `BeginScope`
- Load NLog configuration from [appsettings.json](https://github.com/NLog/NLog.Extensions.Logging/wiki/NLog-configuration-with-appsettings.json)
- Routing logging output to multiple destinations via the available [NLog Targets](https://nlog-project.org/config/?tab=targets)
- Enrich logging output with additional context details via the available [NLog LayoutRenderers](https://nlog-project.org/config/?tab=layout-renderers)
- Rendering logging output into standard formats like JSON, CVS, W3C ELF and XML using [NLog Layouts](https://nlog-project.org/config/?tab=layouts).

If using ASP.NET Core then check [NLog.Web.AspNetCore](https://www.nuget.org/packages/NLog.Web.AspNetCore).

Supported platforms:

- .NET 5, 6 and 7
- .NET Core 2 and 3
- .NET Standard 2.0+

Registration of NLog as logging provider:

```csharp
builder.UseNLog();
```

Useful Links

- [Home Page](https://nlog-project.org/)
- [Change Log](https://github.com/NLog/NLog.Extensions.Logging/releases)
- [Tutorial](https://github.com/NLog/NLog/wiki/Tutorial)
- [Logging Troubleshooting](https://github.com/NLog/NLog/wiki/Logging-troubleshooting)
- [Have a question?](https://stackoverflow.com/questions/tagged/nlog)
9 changes: 6 additions & 3 deletions src/NLog.Extensions.Logging/NLog.Extensions.Logging.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net461;netstandard1.3;netstandard1.5;netstandard2.0;netstandard2.1;net6.0</TargetFrameworks>
<DebugType Condition=" '$(Configuration)' == 'Debug' ">Full</DebugType>
Expand All @@ -24,10 +24,12 @@ Full changelog: https://github.com/NLog/NLog.Extensions.Logging/blob/master/CHAN
List of major changes in NLog 5.0: https://nlog-project.org/2021/08/25/nlog-5-0-preview1-ready.html
</PackageReleaseNotes>
<PackageProjectUrl>https://github.com/NLog/NLog.Extensions.Logging</PackageProjectUrl>
<PackageLicenseExpression>BSD-2-Clause</PackageLicenseExpression>
<PackageIcon>N.png</PackageIcon>
<RepositoryUrl>https://github.com/NLog/NLog.Extensions.Logging.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>BSD-2-Clause</PackageLicenseExpression>
<PackageIcon>N.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>

<!-- SonarQube needs ProjectGuid -->
<ProjectGuid>{6A236D76-C9D9-4B1D-8DDE-F6978D110288}</ProjectGuid>
<SignAssembly>true</SignAssembly>
Expand Down Expand Up @@ -112,6 +114,7 @@ List of major changes in NLog 5.0: https://nlog-project.org/2021/08/25/nlog-5-0-

<ItemGroup>
<None Include="N.png" Pack="true" PackagePath="" Visible="false" />
<None Include="README.md" Pack="true" PackagePath="" />
</ItemGroup>
<Target Name="DownloadMissingContent" BeforeTargets="GenerateNuspec">
<DownloadFile SourceUrl="https://nlog-project.org/N.png" DestinationFolder="$(MSBuildThisFileDirectory)" />
Expand Down
40 changes: 40 additions & 0 deletions src/NLog.Extensions.Logging/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# NLog.Extensions.Logging

[![](https://sonarcloud.io/api/project_badges/measure?project=nlog.extensions.logging&branch=masterr&metric=reliability_rating)](https://sonarcloud.io/dashboard/?id=nlog.web&branch=master)
[![](https://sonarcloud.io/api/project_badges/measure?project=nlog.extensions.logging&branch=master&metric=sqale_rating)](https://sonarcloud.io/dashboard/?id=nlog.web&branch=master)
[![](https://sonarcloud.io/api/project_badges/measure?project=nlog.extensions.logging&branch=master&metric=vulnerabilities)](https://sonarcloud.io/dashboard/?id=nlog.web&branch=master)

Integrates NLog as Logging provider for Microsoft.Extensions.Logging, by just calling `AddNLog()` on the Logging-builder.

Providing features like:

- Capture [structured message properties](https://github.com/NLog/NLog.Extensions.Logging/wiki/NLog-properties-with-Microsoft-Extension-Logging) from the [Microsoft ILogger](https://github.com/NLog/NLog.Extensions.Logging/wiki/NLog-GetCurrentClassLogger-and-Microsoft-ILogger)
- Capture scope context properties from the Microsoft ILogger `BeginScope`
- Load NLog configuration from [appsettings.json](https://github.com/NLog/NLog.Extensions.Logging/wiki/NLog-configuration-with-appsettings.json)
- Routing logging output to multiple destinations via the available [NLog Targets](https://nlog-project.org/config/?tab=targets)
- Enrich logging output with additional context details via the available [NLog LayoutRenderers](https://nlog-project.org/config/?tab=layout-renderers)
- Rendering logging output into standard formats like JSON, CVS, W3C ELF and XML using [NLog Layouts](https://nlog-project.org/config/?tab=layouts).

If using ASP.NET Core then check [NLog.Web.AspNetCore](https://www.nuget.org/packages/NLog.Web.AspNetCore).

Supported platforms:

- .NET 5, 6 and 7
- .NET Core 1, 2 and 3
- .NET Standard 1.3+ and 2.0+
- .NET 4.6.1 - 4.8

Registration of NLog as logging provider:

```csharp
builder.Logging.ClearProviders();
builder.Logging.AddNLog();
```

Useful Links

- [Home Page](https://nlog-project.org/)
- [Change Log](https://github.com/NLog/NLog.Extensions.Logging/releases)
- [Tutorial](https://github.com/NLog/NLog/wiki/Tutorial)
- [Logging Troubleshooting](https://github.com/NLog/NLog/wiki/Logging-troubleshooting)
- [Have a question?](https://stackoverflow.com/questions/tagged/nlog)