从Azure中检索IIS日志 [英] Retrieving IIS Logs from Azure

查看:139
本文介绍了从Azure中检索IIS日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在试图从Azure中获得IIS日志,我能够去得到它去一次 - 现在,无论我怎么努力,我不能让它日志传输到我的存储帐户

我试图做到这一点,而无需重新部署我的code,它周围的阅读似乎后可能。而且,正如我所说,我是成功的。但是,这是推动我疯了,它只是不会做它了。虽然它在我的存储帐户创建队列时,我开始转移,而这一切似乎做的。

我做的基本步骤是:


  • 添加存储名称和关键,我的配置为DiagnosticsConnectionString*。

  • 设置为一分钟DiagnosticMonitorConfiguration,具有DirectoriesBufferConfiguration。

  • 启动一个新的队列名称的按需传输。

我已经做编程所有上述两者,并通过cmdaplets PowerShell的。当我开始传输,它只是一个状态保持尚未出版(不结束/取消)。

我都试过日志,目录甚至删除并重新创建我的存储账户。一切似乎是工作。它似乎在工作的时候直接加我的存储帐户信息通过蔚蓝的门户网站我的角色配置;之后更新了部署,我看到的日志。但是,这是不工作了。有没有人有一些很好的意见/材料?我只是想我的IIS日志传输到存储帐户 - 我一直在这几天

更新:*这是我的配置:我WebRole.cs包含在下,当它的工作:

  DiagnosticMonitor.Start(DiagnosticsConnectionString);

我已经更新它开始传输:

  VAR诊断=新DiagnosticMonitorConfiguration()
{
    ConfigurationChangePollInterval = TimeSpan.FromMinutes(1),
    目录=新DirectoriesBufferConfiguration()
    {
        ScheduledTransferPeriod = TimeSpan.FromMinutes(1)
    },
    日志=新BasicLogsBufferConfiguration()
    {
        ScheduledTransferLogLevelFilter = LogLevel.Verbose,
        ScheduledTransferPeriod = TimeSpan.FromMinutes(1)
    }
};
DiagnosticMonitor.Start(DiagnosticsConnectionString,诊断);


解决方案

更改一行:

  VAR诊断=新DiagnosticMonitorConfiguration()

  VAR诊断= DiagnosticMonitor.GetDefaultInitialConfiguration()

后记,使用现有的对象诊断中,而不是添加您自己的。
这是我的OnStart:

  VAR配置= DiagnosticMonitor.GetDefaultInitialConfiguration();            config.DiagnosticInfrastructureLogs.ScheduledTransferLogLevelFilter = LogLevel.Information;
            config.DiagnosticInfrastructureLogs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1);
            config.Directories.ScheduledTransferPeriod = TimeSpan.FromMinutes(1);
            DiagnosticMonitor.Start(DiagnosticsConnectionString配置);

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

解决方案

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

这篇关于从Azure中检索IIS日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆