Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4627330
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:33:09+00:00 2026-05-22T03:33:09+00:00

I’m sure I have missed something simple but I can’t get simple Trace.WriteLine to

  • 0

I’m sure I have missed something simple but I can’t get simple Trace.WriteLine to work on Azure.

Steps I have taken:

Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString has been set up to our Azure storage account

Import Module Diagnostics to service definition file.

Web config:

  <system.diagnostics>
    <switches>
      <add name="logLevel" value="4" />
    </switches>
    <trace autoflush="false" indentsize="4">
      <listeners>
        <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          name="AzureDiagnostics">
        </add>
      </listeners>
    </trace>

  </system.diagnostics>

WebRole.cs

public class WebRole : RoleEntryPoint
{
    public override bool OnStart()
    {


        String wadConnectionString = "Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString";

        CloudStorageAccount cloudStorageAccount = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue(wadConnectionString));

        RoleInstanceDiagnosticManager roleInstanceDiagnosticManager =
                cloudStorageAccount.CreateRoleInstanceDiagnosticManager(
                RoleEnvironment.DeploymentId,
                RoleEnvironment.CurrentRoleInstance.Role.Name,
                RoleEnvironment.CurrentRoleInstance.Id);

        DiagnosticMonitorConfiguration diagnosticMonitorConfiguration =
            roleInstanceDiagnosticManager.GetCurrentConfiguration();

        diagnosticMonitorConfiguration.Directories.ScheduledTransferPeriod =
               TimeSpan.FromMinutes(5d);

        diagnosticMonitorConfiguration.Logs.ScheduledTransferPeriod =
               TimeSpan.FromMinutes(1d);

        diagnosticMonitorConfiguration.Logs.ScheduledTransferLogLevelFilter = LogLevel.Verbose;

        roleInstanceDiagnosticManager.SetCurrentConfiguration
              (diagnosticMonitorConfiguration);

        Trace.WriteLine("This is the message");
        Debug.Write("This is the debug message");
        System.Diagnostics.Trace.TraceError("message2");
        System.Diagnostics.Trace.TraceWarning("message warning");
        System.Diagnostics.Trace.TraceInformation("message warning");
        Trace.Flush();
        return base.OnStart();

    }
}

Solution is compiled as release.

When I view the objects in the storage account I can see a Table called WADDirectoriesTable and three blobs created called vsdeploy, wad-control-container and was-iis-logfiles.

Nothing that looks like my Trace information.

Many thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T03:33:10+00:00Added an answer on May 22, 2026 at 3:33 am

    Right, sorted!

    This post explains all: http://social.msdn.microsoft.com/Forums/pl-PL/windowsazuredata/thread/d3f2f1d7-f11e-4840-80f7-f61dc11742fb

    It’s because in Azure SDK 1.3 upwards the listeners are different in the webrole.cs file from the rest of the web app due to it running fully in IIS. If I add trace items to the web app itself the table WADLogsTable appears with my trace information.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
Seemingly simple, but I cannot find anything relevant on the web. What is the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I am doing a simple coin flipping experiment for class that involves flipping a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.