Skip to content

Commit c57e535

Browse files
authored
Version 5.2 (#101)
1 parent 4298097 commit c57e535

3 files changed

Lines changed: 29 additions & 16 deletions

File tree

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,21 @@ NLog DiagnosticListenerTarget for [Microsoft DiagnosticSource](https://github.co
2424
</extensions>
2525
```
2626

27+
Alternative register from code using fluent configuration API:
28+
```csharp
29+
LogManager.Setup().SetupExtensions(ext => {
30+
ext.RegisterTarget<NLog.Targets.DiagnosticListenerTarget>();
31+
ext.RegisterLayoutRenderer<NLog.LayoutRenderers.ActivityTraceLayoutRenderer>();
32+
});
33+
```
34+
2735
### How to use ActivityTraceLayoutRenderer
2836
The `System.Diagnostics.Activity.Current` from Microsoft allows one to create OpenTelemetry spans.
29-
NLog can capture the span details together with the LogEvent by using `${activity}` like this:
37+
38+
Example of `NLog.config` file that outputs span-details together with LogEvent by using `${activity}`:
3039

3140
```xml
41+
<nlog>
3242
<extensions>
3343
<add assembly="NLog.DiagnosticSource"/>
3444
</extensions>
@@ -38,6 +48,7 @@ NLog can capture the span details together with the LogEvent by using `${activit
3848
<rules>
3949
<logger minLevel="Info" writeTo="console" />
4050
</rules>
51+
</nlog>
4152
```
4253

4354
**Property Enum Values**
@@ -97,9 +108,10 @@ If creating a custom HostBuilder, then one have to manually setup the ActivityTr
97108

98109
### How to use DiagnosticListenerTarget
99110

100-
Use the target "diagnosticListener" in your nlog.config
111+
Example of `NLog.config` file that uses the `diagnosticListener` target:
101112

102113
```xml
114+
<nlog>
103115
<extensions>
104116
<add assembly="NLog.DiagnosticSource"/>
105117
</extensions>
@@ -109,4 +121,5 @@ Use the target "diagnosticListener" in your nlog.config
109121
<rules>
110122
<logger minLevel="Info" writeTo="diagSource" />
111123
</rules>
124+
</nlog>
112125
```

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ artifacts:
1212
deploy:
1313
- provider: NuGet
1414
api_key:
15-
secure: 5tuxbM+Ujp0ZtaDCGYET23qKr6bJWo/Vzxlf7uTbspaf8R1R7sIe1JqSDHZoK1gV
15+
secure: ACKSV1ixxNpO+2k8KvNDy6hd9QmR8lkQmKn773ZIIeVpG0ywYUhY4j8LcyykVR1a
1616
on:
1717
branch: master

src/NLog.DiagnosticSource/NLog.DiagnosticSource.csproj

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<TargetFrameworks>net60;net461;netstandard2.0</TargetFrameworks>
55
<RootNamespace>NLog</RootNamespace>
6-
<VersionPrefix>5.0.0</VersionPrefix>
6+
<VersionPrefix>5.2.0</VersionPrefix>
77
<VersionSuffix></VersionSuffix>
88

99
<AssemblyVersion>5.0.0.0</AssemblyVersion>
@@ -23,10 +23,10 @@
2323
<PackageIcon>N.png</PackageIcon>
2424
<PackageProjectUrl>https://github.com/NLog/NLog.DiagnosticSource</PackageProjectUrl>
2525
<PackageLicenseExpression>BSD-3-Clause</PackageLicenseExpression>
26+
<PackageReadmeFile>README.md</PackageReadmeFile>
2627
<PackageReleaseNotes>
27-
Removed target platform NET5 and replaced with NET6
28-
Updated to System.Diagnostics.DiagnosticSource v6
29-
Updated to NLog v5
28+
- Updated to NLog v5.2.2
29+
- Updated nuget-package with README.md
3030

3131
See https://github.com/NLog/NLog.DiagnosticSource for documentation of ${activity} and DiagnosticListenerTarget
3232
</PackageReleaseNotes>
@@ -39,21 +39,21 @@ See https://github.com/NLog/NLog.DiagnosticSource for documentation of ${activit
3939
<DelaySign>false</DelaySign>
4040
</PropertyGroup>
4141

42-
<Target Name="DownloadMissingContent" BeforeTargets="GenerateNuspec">
43-
<DownloadFile SourceUrl="https://nlog-project.org/N.png" DestinationFolder="$(MSBuildThisFileDirectory)" />
44-
</Target>
45-
46-
<ItemGroup>
47-
<None Include="N.png" Pack="true" PackagePath="" Visible="false" />
48-
</ItemGroup>
49-
5042
<ItemGroup>
51-
<PackageReference Include="NLog" Version="5.0.5" />
43+
<PackageReference Include="NLog" Version="5.2.2" />
5244
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
5345
</ItemGroup>
5446

5547
<ItemGroup Condition="'$(TargetFramework)'!='net60'">
5648
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="6.0.0" />
5749
</ItemGroup>
5850

51+
<ItemGroup>
52+
<None Include="../../README.md" Pack="true" PackagePath="" />
53+
<None Include="N.png" Pack="true" PackagePath="" Visible="false" />
54+
</ItemGroup>
55+
<Target Name="DownloadMissingContent" BeforeTargets="GenerateNuspec">
56+
<DownloadFile SourceUrl="https://nlog-project.org/N.png" DestinationFolder="$(MSBuildThisFileDirectory)" />
57+
</Target>
58+
5959
</Project>

0 commit comments

Comments
 (0)