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?

有帮助吗?

解决方案

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

其他提示

It is 6 months later than this question. I am observing that Trace.WriteLine("Hello trace"); - works with Visual Studio 2013 Update 4, but - it does not work with Visual Studio 2015 CTP 5. However, if the debugger is attached, then Trace.WriteLine(string) statements do appear in the Debug output window. Of course, the Azure Website settings must be set to Application Logging of "Verbose".

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top