4

I have been trying to get IIS Logs from Azure, and I was able to get to get it going once - now, no matter what I try, I can't get it to transfer logs to my Storage account.

I was trying to do this without re-deploying my code, which after reading around seemed possible. And, as I mentioned, I was successful. But this is driving me insane, it just won't do it anymore. Although, it does create the Queue in my storage account when I start a transfer, but that's all it seems to do.

The basic steps I am doing are:

  • Adding the storage name and key to my config as "DiagnosticsConnectionString"*.
  • Setting a DiagnosticMonitorConfiguration for one minute, with a DirectoriesBufferConfiguration.
  • Starting an OnDemand Transfer with a new queue name.

I've done all of the above both programmatically, and through the cmdaplets for PowerShell. As soon as I start a transfer, it just stays with a status of "Not Yet Published (Do not end/cancel)".

I have tried Logs, Directories and even deleted and recreated my storage account. Nothing seems to be working. It appeared to work when I directly added my storage account info to my role config via the azure portal; after it Updated the deployment I saw the logs. But this is not working anymore. Does anyone have some good advice/material? I just want to transfer my IIS logs to my storage account - I've been at it for days.

Update:*This is my config: . My WebRole.cs contained the following, when it worked:

DiagnosticMonitor.Start("DiagnosticsConnectionString");

I've updated it to start transfers:

var diag = new DiagnosticMonitorConfiguration()
{
    ConfigurationChangePollInterval = TimeSpan.FromMinutes(1),
    Directories = new DirectoriesBufferConfiguration()
    {
        ScheduledTransferPeriod = TimeSpan.FromMinutes(1)
    },
    Logs = new BasicLogsBufferConfiguration()
    {
        ScheduledTransferLogLevelFilter = LogLevel.Verbose,
        ScheduledTransferPeriod = TimeSpan.FromMinutes(1)
    }
};
DiagnosticMonitor.Start("DiagnosticsConnectionString", diag);
nullable
  • 2,513
  • 1
  • 29
  • 32
  • Can you post the configuration of your azure deployment after you have modified it with remote diagnostics? Obviously remove private info – Igorek Nov 21 '10 at 22:17
  • I've updated my question to include the configuration. It's worth mentioning I've changed the interval to 5 minutes, remotely - per http://stackoverflow.com/questions/4170285/where-is-the-diagnostics-logs-storage-tables – nullable Nov 21 '10 at 22:53

2 Answers2

4

Change one line:

From

var diag = new DiagnosticMonitorConfiguration()

to

var diag = DiagnosticMonitor.GetDefaultInitialConfiguration()

Afterwords, use the existing objects within the diag and not add your own. This is my OnStart:

            var config = DiagnosticMonitor.GetDefaultInitialConfiguration();

            config.DiagnosticInfrastructureLogs.ScheduledTransferLogLevelFilter = LogLevel.Information;
            config.DiagnosticInfrastructureLogs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1);
            config.Directories.ScheduledTransferPeriod = TimeSpan.FromMinutes(1);
            DiagnosticMonitor.Start("DiagnosticsConnectionString", config);
Igorek
  • 15,716
  • 3
  • 54
  • 92
  • I think this did the trick! Thank you. I remember using this before, but I re wrote my remote application to force the transfer of these logs, and I initiated the configuration myself. Thanks for the pointer! I ran out of ideas. – nullable Nov 22 '10 at 03:02
  • I had the same issue at one time when I was coding. Glad to help – Igorek Nov 22 '10 at 03:14
1

It could be that the logs are not being generated, rather than a problem at the download time.

There is a progam called AzureLogFetcher that may help, tips on getting logging to work can be found here

Shiraz Bhaiji
  • 64,065
  • 34
  • 143
  • 252