Questions tagged [etw-eventsource]

Event Tracing for Windows (ETW) is a fast, scalable logging mechanism built into the Windows operating system. The EventSource class simplifies writing ETW provider as simple as writing just a few lines of code instead of creating a XML manifest, using the tool (MC.exe) to generate source code and registering the provider using the tool WEVTUTIL when the application was deployed.

Event Tracing for Windows (ETW) is a fast, scalable logging mechanism built into the Windows operating system. The EventSource class simplifies writing ETW provider as simple as writing just a few lines of code instead of creating a XML manifest, using the tool (MC.exe) to generate source code and registering the provider using the tool WEVTUTIL when the application was deployed.

Small Demo Example:

sealed class MinimalEventSource : EventSource
{
    public void Load(long ImageBase, string Name) { WriteEvent(1, ImageBase, Name); }

    public static MinimalEventSource Log = new MinimalEventSource();
}

Calling in code:

MinimalEventSource.Log.Load(10, “MyFile”);
68 questions
23
votes
3 answers

Risk of missing events from ETW logging with EventSource

I'm instrumenting my .NET 4.5 applications to emit ETW events using the EventSource class. The goal is to be able to capture some of these events (the Error level events) for error logging. After doing some reading and testing, I am concerned about…
TCC
  • 2,546
  • 1
  • 24
  • 35
16
votes
3 answers

What is the best way to log exceptions using ETW?

Is there a standard way to log exceptions using ETW? As far as I have seen the only way to do this is to log the message and possibly the inner exception message as there is not strongly typed parameter for the Exception type.
jaffa
  • 26,770
  • 50
  • 178
  • 289
8
votes
5 answers

Why does implementing an interface on a subclass of EventSource throw an exception at runtime?

I'm trying to use Event Tracing for Windows (ETW) in my .NET application via the EventSource class that was included in .NET 4.5. I'm subclassing EventSource as MyEventSource and trying to implement an interface IMyEventSource (for mocking purposes)…
Mike
  • 7,500
  • 8
  • 44
  • 62
7
votes
2 answers

EventSource/Enterprise Library Logging caches deleted methods, (possibly in a instrumentationManifest!)

Short version If I change this ... EventSource(Name="BasicLogger") public class BasicLogger : EventSource { ... } to this ... EventSource(Name="HardymanDatabaseLog") public class BasicLogger : EventSource { ... } ... I still receive log messages,…
7
votes
3 answers

Dependency concerns Implementing EventSource for semantic logging in large application

I'm working on a large product consisting of a three windows services and several normal windows applications (.exe). Now we want to move to ETW and Semantic Logging, and use the Microsoft.Diagnostics.Tracing.EventSource. I read somewhere that all…
DeCaf
  • 6,026
  • 1
  • 29
  • 51
7
votes
1 answer

Is it possible to subclass an EventSource in ETW?

I'd like to be able to declare an EventSource which has a minimum of several methods which by default provide regular logging facilities. e.g. Info() Warn() Error() In addition I'd like to be able to within each service, define a specific event…
jaffa
  • 26,770
  • 50
  • 178
  • 289
6
votes
2 answers

Why the restriction on parameter type and count on EventSource Methods

I am experimenting at the moment with Microsoft EventSources in C#. One restriction is the following ...The number and types of arguments passed to the ETW method must exactly match the types passed to the WriteEvent overload it calls. For…
rudimenter
  • 3,242
  • 4
  • 33
  • 46
6
votes
1 answer

Getting information about an error with EventSource

I'm trying to get information about an error when using EventSource in NodeJs, I think you could understand me better with the following example: var url = 'http://api.example.com/resource' var EventSource = require('eventsource'); var es = new…
Gepser Hoil
  • 3,998
  • 4
  • 24
  • 34
5
votes
2 answers

eventregister.exe fails to load Azure ServiceRuntime

We are using the EventSource nuget package, but we are getting a build error: 1>EXEC : error : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. 1> LoaderException: 1>…
noocyte
  • 2,484
  • 5
  • 29
  • 44
5
votes
2 answers

.Net 4.5 EventSource ETW provider not showing up in provider list

I have been working on using .NET4.5 new feature ETW(EventSource). I have trouble having it show up on the trace provider lists using perfmon->Data Collector Sets. I was able to see the logs using perfview. I was able to generate manifest from…
Rajesh B
  • 63
  • 1
  • 8
4
votes
1 answer

Using a System.Exception Object in EventSource

I'm trying to use Event Source (Microsoft.Diagnostics.EventFlow.Inputs.EventSource) to create an event that is handled by Event Flow (Microsoft.Diagnostic.EventFlow) and whose output is passed to Application Insights…
4
votes
1 answer

How to remotely register static ETW manifests as part of a website deployment?

I'm doing a pilot effort to use the new EventSource (Microsoft.Diagnostics.Tracing.EventSource from nuget) and its new support for ETW channels in order to write to the windows event log. The code is in place, and it writes properly to my…
bwerks
  • 8,651
  • 14
  • 68
  • 100
3
votes
1 answer

Uninstall event source (ETW) without manifest file?

What is the best way to uninstall / delete previously installed event sources without using manifest? For example. If I have something like: [EventSource(Name = "Corporation-Module-X")] public sealed class XEventSource : EventSource { …
Zeljko
  • 250
  • 1
  • 2
  • 12
3
votes
1 answer

PerfView not able to capture custom ETW events

I have a demo solution which raises events by using System.Diagnostics.Tracing.EventSource class. The class I have is as below:- [EventSource(Guid = "B6741490-9F53-4620-A45C-49004C1B4444", Name = "DemoEvent")] sealed public class DemoEventSource :…
AvinashK
  • 3,309
  • 8
  • 43
  • 94
3
votes
0 answers

How to unit test my own implementation of EventSource

I'm using System.Diagnostics.EventSource for semantic logging (.net 4.5). I would like to create proper unit tests to make sure that the events were actually fired with the appropriate content. How can I do that? Example of method to…
rlesias
  • 4,786
  • 3
  • 15
  • 20
1
2 3 4 5