locked
ETW Trace Logging Issues RRS feed

  • Question

  • After logging to an ETL file with the .NET EventSource class

    var eventSource = new EventSource("Log");
    eventSource.Write("Test", new {
      num = 1234,
      text1 = "12345",
      text2 = "123456789012345678",
      date = new DateTime(2015, 1, 30, 9, 0, 0)
    });
    

    The WPA tool shows the expected results

    Provider Name, Task Name, num (Field 1), text1 (Field 2), text2 (Field 3), date (Field 4)
     Log, Test, 1234, 12345, 123456789012345678, 01/30/2015 09:00:00.000

    But the Message Analyzer parses the data incorrectly and shows
     Test: date=2015-01-30T10:00:00.0000000,num=210,text1=\n
     12345n...,text2=$123456789012345678...

    Thursday, October 22, 2015 6:30 AM

Answers

  • I was able to repro, and I filed a bug. It should be fixed in the next release.

    Thanks,

    Paul

     
    • Marked as answer by Paul E Long Tuesday, November 10, 2015 8:24 PM
    Tuesday, November 10, 2015 8:24 PM

All replies

  • I was able to get your code example working by using .net 4.6, but I have yet to understand where the resulting .ETL file be. I'll probably be able to find it sooner or later, but perhaps can you tell me where to find it?

    Paul

    Wednesday, October 28, 2015 8:58 PM
  • You can create the ETL file with

    PerfView /onlyProviders=*Log collect

    Or you can use the tools Logman, XPerf, WPR, ...

    On some tools you can use the provider name "*Log" on others you need the GUID.

    The GUID from "Log" is {60d37c7d-0ff0-576c-20d1-b99ec610bf29} (eventSource.Guid).

    http://blogs.msdn.com/b/dcook/archive/2015/09/08/etw-provider-names-and-guids.aspx

    Power Shell:
    New-EtwTraceSession -Name Log1 -LocalFilePath C:\PerfLogs\Log1.etl
    Add-EtwTraceProvider -SessionName Log1 -Guid "{60d37c7d-0ff0-576c-20d1-b99ec610bf29}"
    Run App with Log Provider
    Remove-EtwTraceSession -Name Log1
    • Edited by Steffen Zeidler Sunday, November 1, 2015 6:57 AM Add Power Shell Script
    Thursday, October 29, 2015 7:01 AM
  • I was able to repro, and I filed a bug. It should be fixed in the next release.

    Thanks,

    Paul

     
    • Marked as answer by Paul E Long Tuesday, November 10, 2015 8:24 PM
    Tuesday, November 10, 2015 8:24 PM