NLog.Etw 5.2.2

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
dotnet add package NLog.Etw --version 5.2.2
NuGet\Install-Package NLog.Etw -Version 5.2.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NLog.Etw" Version="5.2.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NLog.Etw --version 5.2.2
#r "nuget: NLog.Etw, 5.2.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install NLog.Etw as a Cake Addin
#addin nuget:?package=NLog.Etw&version=5.2.2

// Install NLog.Etw as a Cake Tool
#tool nuget:?package=NLog.Etw&version=5.2.2

NLog.Etw

Version AppVeyor codecov.io

NLog Target for writing logevents to Event Tracing for Windows (ETW).

Install nuget-package to your project:

dotnet add package NLog.Etw

Example NLog.config file

Example of NLog.config-file that writes to ETW:

<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      autoReload="true"
      throwExceptions="false">

    <extensions>
        <add assembly="NLog.Etw" />
    </extensions>

    <targets async="true">
        <target xsi:type="EtwEventSource"
                name="eetw"
                providerName="MyEventSourceName"
                taskName="${level}"
                layout="${message}"
              />
    </targets>
    
    <rules>
      <logger name="*" minlevel="Trace" writeTo="eetw" />
    </rules>
</nlog>

Example Custome EventSource

Example of providing own custom EventSource for writing events:

[EventSource(Name = "MyEventSourceName")]
public class MyEventSource : EventSource, NLog.Etw.INLogEventSource
{
    /// <inheritdoc/>
    [NonEvent]
    public void Write(EventLevel eventLevel, string layoutMessage, LogEventInfo logEvent)
    {
        // TODO Call own custom logging-method
    }

    /// <inheritdoc/>
    EventSource EventSource { get { return this; } }

    internal readonly static MyEventSource Log = new MyEventSource();
}

var config = new NLog.Config.LoggingConfiguration();
config.AddRuleForAllLevels(new NLog.Etw.NLogEtwExtendedTarget(MyEventSource.Log) { Name = "eetw" });
NLog.LogManager.Configuration = config;
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 is compatible.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
5.2.2 4,311 10/15/2023
5.0.0 78,330 8/17/2022
4.3.0 90,419 8/31/2019
4.2.0 1,942 1/25/2019
4.1.0 21,967 10/25/2016
4.0.1 1,590 12/18/2015
4.0.0 1,416 12/17/2015
1.1.0 1,196 8/25/2015

- Updated to NLog v5.2.2
- Added package README.md