gpt4 book ai didi

c# - azure : I don't see all my Trace log

转载 作者:行者123 更新时间:2023-12-03 04:39:15 28 4
gpt4 key购买 nike

我使用 VisualStudio2010 和模拟器工具(2012 年 6 月)。
我创建了一个新的工作角色项目。

WorkerRole.cs文件中:

public class WorkerRole : RoleEntryPoint
{
public override void Run()
{
Trace.TraceInformation("Begin loop at " + DateTime.Now);
int i = 0;
while (true)
{
Trace.TraceInformation("I'm in a loop (" + i++ + ") at " + DateTime.Now + ".");
Thread.Sleep(15000);
}
}

private void InitLogs()
{
DiagnosticMonitorConfiguration config = DiagnosticMonitor.GetDefaultInitialConfiguration();
config.Logs.ScheduledTransferLogLevelFilter = LogLevel.Verbose;
config.Logs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1);

DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", config);
Trace.TraceInformation("Start at " + DateTime.Now);
}

public override bool OnStart()
{
ServicePointManager.DefaultConnectionLimit = 12;
InitLogs();
return base.OnStart();
}
}

在我的设置中:

Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString = UseDevelopmentStorage=true

app.config中:

<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
</system.diagnostics>

当我在本地开始调试 (F5) 时,我可以在 Windows Azure 计算模拟器中看到这一点:

[fabric] Role Instance: deployment16(275).WindowsAzureProject2.WorkerRole1.0
[fabric] Role state Started
[Diagnostics]: UpdateState(Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorStartupInfo, Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorConfiguration, )
[runtime] Role entrypoint . CALLING OnStart()
[Diagnostics]: Acquired mutex
[Diagnostics] Information: C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor
[Diagnostics] Information: c:\users\benjamin.lux\documents\visual studio 2010\Projects\WindowsAzureProject2\WindowsAzureProject2\csx\Debug\roles\WorkerRole1\diagnostics\x64\monitor\MonAgentHost.exe -LocalPath "C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor" -StaticConfigFile "C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor\Configuration\mastaticconfig.xml" -ConfigFile "C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor\Configuration\maconfig.xml" -ShutDownEvent WADDM-ShutDown-54bc885b045e40ecaf8474c810199ab5 -InitializedEvent WADM-StartUp-54bc885b045e40ecaf8474c810199ab5 -parent 7656 -events
[Diagnostics]: UpdateState(Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorStartupInfo, Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorConfiguration, )
[Diagnostics]: Mutex already taken
[Diagnostics]: Creating config channel client
[Diagnostics]: Attempting to connect to server...
[MonAgentHost] Error: MA EVENT: 2012-07-09T08:17:40.111Z
[MonAgentHost] Error: 2
[MonAgentHost] Error: 6920
[MonAgentHost] Error: 4636
[MonAgentHost] Error: SelfMonitoring
[MonAgentHost] Error: 0
[MonAgentHost] Error: x:\btsdx\215\services\monitoring\agent\dll\selfmon.cpp
[MonAgentHost] Error: MASelfMon::GetProcCntrs
[MonAgentHost] Error: 1421
[MonAgentHost] Error: ffffffffc0000bb8
[MonAgentHost] Error: 0
[MonAgentHost] Error:
[MonAgentHost] Error: PdhAddCounter(\Process(MonAgentHost#0)\ID Process) failed
[Diagnostics]: Creating config channel server
[MonAgentHost] Output: Agent will exit when WADDM-ShutDown-54bc885b045e40ecaf8474c810199ab5 is signaled.
[MonAgentHost] Output: Will signal WADM-StartUp-54bc885b045e40ecaf8474c810199ab5 after the agent is initialized.
[MonAgentHost] Output: Registered as an event consumer.
[MonAgentHost] Output: Agent will exit when parent process 7656 exits.
[MonAgentHost] Output: Monitoring Agent Started
[Diagnostics]: Starting configuration channel polling
[Diagnostics]: Connection sucessful, sending config
[WaWorkerHost.exe] Start at 09/07/2012 10:17:40
[runtime] Role entrypoint . COMPLETED OnStart()
[Diagnostics]: Config request received
[Diagnostics]: Signalling process restart on event = WADDM-ShutDown-54bc885b045e40ecaf8474c810199ab5
[MonAgentHost] Error: MA EVENT: 2012-07-09T08:17:40.662Z
[MonAgentHost] Error: 3
[MonAgentHost] Error: 6920
[MonAgentHost] Error: 4636
[MonAgentHost] Error: SelfMonitoring
[MonAgentHost] Error: 0
[MonAgentHost] Error: x:\btsdx\215\services\monitoring\agent\dll\selfmon.cpp
[MonAgentHost] Error: MASelfMon::StartTerminationCountdown
[MonAgentHost] Error: 1088
[MonAgentHost] Error: 10011
[MonAgentHost] Error: 0
[MonAgentHost] Error:
[MonAgentHost] Error: Not starting termination thread inside a client hosted monitoring agent
[MonAgentHost] Output: Exiting the monitoring agent 6920 after the shutdown event was signaled.
[MonAgentHost] Output: Monitoring Agent Stopped
[Diagnostics] Information: Diagnostic process exited with code: 0
[runtime] Role entrypoint . CALLING Run()
[WaWorkerHost.exe] Begin loop at 09/07/2012 10:17:40
[WaWorkerHost.exe] I'm in a loop (0) at 09/07/2012 10:17:40.
[Diagnostics] Information: C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor
[Diagnostics] Information: c:\users\benjamin.lux\documents\visual studio 2010\Projects\WindowsAzureProject2\WindowsAzureProject2\csx\Debug\roles\WorkerRole1\diagnostics\x64\monitor\MonAgentHost.exe -LocalPath "C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor" -StaticConfigFile "C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor\Configuration\mastaticconfig.xml" -ConfigFile "C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor\Configuration\maconfig.xml" -ShutDownEvent WADDM-ShutDown-5548c4bc522e4f858d6ab6df287747cf -InitializedEvent WADM-StartUp-5548c4bc522e4f858d6ab6df287747cf -parent 7656 -events
[MonAgentHost] Error: MA EVENT: 2012-07-09T08:17:42.930Z
[MonAgentHost] Error: 2
[MonAgentHost] Error: 6260
[MonAgentHost] Error: 5472
[MonAgentHost] Error: SelfMonitoring
[MonAgentHost] Error: 0
[MonAgentHost] Error: x:\btsdx\215\services\monitoring\agent\dll\selfmon.cpp
[MonAgentHost] Error: MASelfMon::GetProcCntrs
[MonAgentHost] Error: 1421
[MonAgentHost] Error: ffffffffc0000bb8
[MonAgentHost] Error: 0
[MonAgentHost] Error:
[MonAgentHost] Error: PdhAddCounter(\Process(MonAgentHost#0)\ID Process) failed
[MonAgentHost] Output: Agent will exit when WADDM-ShutDown-5548c4bc522e4f858d6ab6df287747cf is signaled.
[MonAgentHost] Output: Will signal WADM-StartUp-5548c4bc522e4f858d6ab6df287747cf after the agent is initialized.
[MonAgentHost] Output: Registered as an event consumer.
[MonAgentHost] Output: Agent will exit when parent process 7656 exits.
[MonAgentHost] Output: Monitoring Agent Started
[Diagnostics]: Starting configuration channel polling
[WaWorkerHost.exe] I'm in a loop (1) at 09/07/2012 10:17:55.
[WaWorkerHost.exe] I'm in a loop (2) at 09/07/2012 10:18:10.
[MonAgentHost] Error: MA EVENT: 2012-07-09T08:18:15.202Z
[MonAgentHost] Error: 2
[MonAgentHost] Error: 6260
[MonAgentHost] Error: 5412
[MonAgentHost] Error: NetTransport
[MonAgentHost] Error: 0
[MonAgentHost] Error: x:\btsdx\215\services\monitoring\shared\nettransport\src\netutils.cpp
[MonAgentHost] Error: OpenHttpSession
[MonAgentHost] Error: 749
[MonAgentHost] Error: 0
[MonAgentHost] Error: 2f94
[MonAgentHost] Error:
[MonAgentHost] Error: WinHttpGetProxyForUrl(http://127.0.0.1) failed ERROR_WINHTTP_AUTODETECTION_FAILED (12180)
[MonAgentHost] Error: MA EVENT: 2012-07-09T08:18:22.313Z
[MonAgentHost] Error: 2
[MonAgentHost] Error: 6260
[MonAgentHost] Error: 7912
[MonAgentHost] Error: NetTransport
[MonAgentHost] Error: 0
[MonAgentHost] Error: x:\btsdx\215\services\monitoring\shared\nettransport\src\netutils.cpp
[MonAgentHost] Error: OpenHttpSession
[MonAgentHost] Error: 749
[MonAgentHost] Error: 0
[MonAgentHost] Error: 2f94
[MonAgentHost] Error:
[MonAgentHost] Error: WinHttpGetProxyForUrl(http://127.0.0.1) failed ERROR_WINHTTP_AUTODETECTION_FAILED (12180)
[MonAgentHost] Error: MA EVENT: 2012-07-09T08:18:24.578Z
[MonAgentHost] Error: 2
[MonAgentHost] Error: 6260
[MonAgentHost] Error: 7912
[MonAgentHost] Error: NetTransport
[MonAgentHost] Error: 0
[MonAgentHost] Error: x:\btsdx\215\services\monitoring\shared\nettransport\src\netutils.cpp
[MonAgentHost] Error: OpenHttpSession
[MonAgentHost] Error: 749
[MonAgentHost] Error: 0
[MonAgentHost] Error: 2f94
[MonAgentHost] Error:
[MonAgentHost] Error: WinHttpGetProxyForUrl(http://127.0.0.1) failed ERROR_WINHTTP_AUTODETECTION_FAILED (12180)
[WaWorkerHost.exe] I'm in a loop (3) at 09/07/2012 10:18:25.
[Diagnostics]: Checking for configuration updates 09/07/2012 10:18:40.
[WaWorkerHost.exe] I'm in a loop (4) at 09/07/2012 10:18:40.
[Diagnostics]: Signalling process restart on event = WADDM-ShutDown-5548c4bc522e4f858d6ab6df287747cf
[MonAgentHost] Error: MA EVENT: 2012-07-09T08:18:40.731Z
[MonAgentHost] Error: 3
[MonAgentHost] Error: 6260
[MonAgentHost] Error: 5472
[MonAgentHost] Error: SelfMonitoring
[MonAgentHost] Error: 0
[MonAgentHost] Error: x:\btsdx\215\services\monitoring\agent\dll\selfmon.cpp
[MonAgentHost] Error: MASelfMon::StartTerminationCountdown
[MonAgentHost] Error: 1088
[MonAgentHost] Error: 10011
[MonAgentHost] Error: 0
[MonAgentHost] Error:
[MonAgentHost] Error: Not starting termination thread inside a client hosted monitoring agent
[MonAgentHost] Output: Exiting the monitoring agent 6260 after the shutdown event was signaled.
[MonAgentHost] Output: Monitoring Agent Stopped
[Diagnostics] Information: Diagnostic process exited with code: 0
[Diagnostics] Information: C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor
[Diagnostics] Information: c:\users\benjamin.lux\documents\visual studio 2010\Projects\WindowsAzureProject2\WindowsAzureProject2\csx\Debug\roles\WorkerRole1\diagnostics\x64\monitor\MonAgentHost.exe -LocalPath "C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor" -StaticConfigFile "C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor\Configuration\mastaticconfig.xml" -ConfigFile "C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor\Configuration\maconfig.xml" -ShutDownEvent WADDM-ShutDown-88b62f24f2154dbabb56a138a624ff8a -InitializedEvent WADM-StartUp-88b62f24f2154dbabb56a138a624ff8a -parent 7656 -events
[MonAgentHost] Error: MA EVENT: 2012-07-09T08:18:42.920Z
[MonAgentHost] Error: 2
[MonAgentHost] Error: 6068
[MonAgentHost] Error: 7820
[MonAgentHost] Error: SelfMonitoring
[MonAgentHost] Error: 0
[MonAgentHost] Error: x:\btsdx\215\services\monitoring\agent\dll\selfmon.cpp
[MonAgentHost] Error: MASelfMon::GetProcCntrs
[MonAgentHost] Error: 1421
[MonAgentHost] Error: ffffffffc0000bb8
[MonAgentHost] Error: 0
[MonAgentHost] Error:
[MonAgentHost] Error: PdhAddCounter(\Process(MonAgentHost#0)\ID Process) failed
[MonAgentHost] Output: Agent will exit when WADDM-ShutDown-88b62f24f2154dbabb56a138a624ff8a is signaled.
[MonAgentHost] Output: Will signal WADM-StartUp-88b62f24f2154dbabb56a138a624ff8a after the agent is initialized.
[MonAgentHost] Output: Registered as an event consumer.
[MonAgentHost] Output: Agent will exit when parent process 7656 exits.
[MonAgentHost] Output: Monitoring Agent Started
[Diagnostics]: Starting configuration channel polling
[WaWorkerHost.exe] I'm in a loop (5) at 09/07/2012 10:18:55.
[WaWorkerHost.exe] I'm in a loop (6) at 09/07/2012 10:19:10.
[MonAgentHost] Error: MA EVENT: 2012-07-09T08:19:15.198Z
[MonAgentHost] Error: 2
[MonAgentHost] Error: 6068
[MonAgentHost] Error: 612
[MonAgentHost] Error: NetTransport
[MonAgentHost] Error: 0
[MonAgentHost] Error: x:\btsdx\215\services\monitoring\shared\nettransport\src\netutils.cpp
[MonAgentHost] Error: OpenHttpSession
[MonAgentHost] Error: 749
[MonAgentHost] Error: 0
[MonAgentHost] Error: 2f94
[MonAgentHost] Error:
[MonAgentHost] Error: WinHttpGetProxyForUrl(http://127.0.0.1) failed ERROR_WINHTTP_AUTODETECTION_FAILED (12180)
[MonAgentHost] Error: MA EVENT: 2012-07-09T08:19:22.313Z
[MonAgentHost] Error: 2
[MonAgentHost] Error: 6068
[MonAgentHost] Error: 7748
[MonAgentHost] Error: NetTransport
[MonAgentHost] Error: 0
[MonAgentHost] Error: x:\btsdx\215\services\monitoring\shared\nettransport\src\netutils.cpp
[MonAgentHost] Error: OpenHttpSession
[MonAgentHost] Error: 749
[MonAgentHost] Error: 0
[MonAgentHost] Error: 2f94
[MonAgentHost] Error:
[MonAgentHost] Error: WinHttpGetProxyForUrl(http://127.0.0.1) failed ERROR_WINHTTP_AUTODETECTION_FAILED (12180)
[MonAgentHost] Error: MA EVENT: 2012-07-09T08:19:24.577Z
[MonAgentHost] Error: 2
[MonAgentHost] Error: 6068
[MonAgentHost] Error: 7748
[MonAgentHost] Error: NetTransport
[MonAgentHost] Error: 0
[MonAgentHost] Error: x:\btsdx\215\services\monitoring\shared\nettransport\src\netutils.cpp
[MonAgentHost] Error: OpenHttpSession
[MonAgentHost] Error: 749
[MonAgentHost] Error: 0
[MonAgentHost] Error: 2f94
[MonAgentHost] Error:
[MonAgentHost] Error: WinHttpGetProxyForUrl(http://127.0.0.1) failed ERROR_WINHTTP_AUTODETECTION_FAILED (12180)
[WaWorkerHost.exe] I'm in a loop (7) at 09/07/2012 10:19:25.
[WaWorkerHost.exe] I'm in a loop (8) at 09/07/2012 10:19:40.

所以我可以看到跟踪消息 0、1、2、3、4、5、6、7 和 8。
但是,当我查看“WADLogsTable”时,我只看到消息:开始、1、2、3 和 4,无开始,数字 0 和 5、6、7 和 8

两个主要问题:他们在哪里?
如果我在日志记录的两个“传输周期”之间停止一个实例,会发生什么?在这种情况下,我的最后日志已保存,还是必须使用 DeploymentDiagnosticManager 类强制上传?

第二个问题是因为也许最后 4 条消息不是问题。

Windows Azure 计算模拟器中的信息错误并不重要:blog post

编辑 09/07/2012 :澄清情况。

编辑 16/07/2012 :如果有人可以创建一个新的 worker 角色项目并添加上面的代码,然后按 F5。我想知道这是个人交易还是模拟器(或其他)的问题。

最佳答案

根据我的经验,您必须在启动诊断监视器之前使用 SetCurrentConfiguration,否则跟踪日志不会传输到 WadLogsTable。这将使用当前日志传输时间来移动日志。您还可以在日志中添加时间标记以查看创建时间吗?

关于c# - azure : I don't see all my Trace log,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11365568/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com