Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nlog/nlog.etw
NLog Target for Event Tracing for Windows (ETW)
https://github.com/nlog/nlog.etw
csharp dotnet etw netstandard20 nlog nlog-target
Last synced: 10 days ago
JSON representation
NLog Target for Event Tracing for Windows (ETW)
- Host: GitHub
- URL: https://github.com/nlog/nlog.etw
- Owner: NLog
- License: apache-2.0
- Created: 2015-06-14T19:48:18.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-05-18T08:48:18.000Z (8 months ago)
- Last Synced: 2024-12-06T17:48:35.495Z (27 days ago)
- Topics: csharp, dotnet, etw, netstandard20, nlog, nlog-target
- Language: C#
- Homepage:
- Size: 1.13 MB
- Stars: 13
- Watchers: 7
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NLog.Etw
[![Version](https://badge.fury.io/nu/NLog.Etw.svg)](https://www.nuget.org/packages/NLog.Etw)
[![AppVeyor](https://img.shields.io/appveyor/ci/nlog/nlog-Etw/master.svg)](https://ci.appveyor.com/project/nlog/nlog-Etw/branch/master)
[![codecov.io](https://codecov.io/github/NLog/NLog.Etw/coverage.svg?branch=master)](https://codecov.io/github/NLog/NLog.Etw?branch=master)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
```
## Example Custome EventSource
Example of providing own custom EventSource for writing events:
```c#
[EventSource(Name = "MyEventSourceName")]
public class MyEventSource : EventSource, NLog.Etw.INLogEventSource
{
///
[NonEvent]
public void Write(EventLevel eventLevel, string layoutMessage, LogEventInfo logEvent)
{
// TODO Call own custom logging-method
}///
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;
```### Example with EtwEventCounter Target
Example of `NLog.config`-file that writes to ETW-EventCounter:
```xml
```