문제

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