开发者

Retrieving IIS Logs from Azure

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开发者_StackOverflow中文版 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);


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);


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜