Search code examples
c#azurevisual-studio-debuggingtrace

System.Diagnostics.Tracing with Azure Website


I want to use tracing with Windows Azure but I am having difficulty setting it up to work correctly.

Firstly, I have my Trace.Write commands embedded within my code, like this:

private static void DefineBallistics(MigraDoc.DocumentObjectModel.Document document, Motivation motivation)
        {
            Trace.Write("Defining Pdf Motivation ballistics.");

            Section section = document.AddSection();
            section.AddParagraph("Firearm information and ballistics", "Heading1");
            foreach (FileItem fi in motivation.Calibre.FileItems)
            {
                InsertImageOrPdf(document, section, fi);
            }
        }

Then, I have application logging enabled on Windows Azure website configuration section as follows:

enter image description here

So, if I run the code, it seems as if no tracing information is being captured. In fact, the console window does not display any streaming tracing log information and when I download the log files, there is no application log files contained within the downloaded zip file.

enter image description here

What am I missing?


Solution

  • I replaced Trace.Write with Trace.TraceInformation, which has solved the problem for me.