Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
36 lines (22 sloc) 1.15 KB


This implements the TraceListener intended for .NET applicaiton deployed to Windows Azure as WebSites.


  • Simple clone and build.cmd to build the project.
  • Add AzureTraceListener.dll as an Assembly reference to your .NET project.
  • Make sure you commit this assembly as part of your repo.

Include AzureTraceListener as a TraceListener to your app

You may do one of the following.

  • Imperative thru codes in Application_Start. It is important that the path to LogFiles is ..\..\LogFiles\<yourapp>.

    Trace.Listeners.Add(new AzureTraceListener.AzureTraceListener(@"..\..\LogFiles\aspnet01"));

  • Add to web.config

      <trace autoflush="true" indentsize="4">
          <add name="TextListener"
            type="AzureTraceListener.AzureTraceListener, AzureTraceListener"
            initializeData="..\..\logFiles\aspnet01" />
          <remove name="Default" />

That's it. You should be able to use System.Diagnostics.Trace in your application and see the trace files.