tags:

views:

220

answers:

3

With the ASP.NET Events ETW (Event Tracing for Windows) provider, can I write custom messages to the trace from an ASP.NET page?

+2  A: 

Have you considered utilizing the ASP.NET Tracing functionality?

WEB.CONFIG

<configuration>
 <system.web>
  <trace enabled="true" requestLimit="40" localOnly="false"/>
 </system.web>
</configuration>

CODE TO CREATE TRACE MESSAGE

Trace.Warn("TITLE", "TEXT/COMMENT");


It appears that this may be possible. Read this info from MSDN. Specifically, it appears that you would use the Windows Performance Analyzer (WPA).

Further Reading:
* MSDN: How To Use Custom Performance Counters from ASP.NET
* MSDN: Performance Counters for ASP.NET

RSolberg
A: 

A native (Win32) application can write Event Tracing for Windows (ETW) messages. Therefore .NET applications can, but it might require an adapter layer or significant work with P/Invoke to achieve it.

Three (possibly) relevant articles from MSDN Magazine are here, here and here.

There is some information about ETW events from the .NET Framework itself here.

[This is work in progress for me.]

Richard
A: 

Here is how you can write custom ETW within managed code

Naveen