【发布时间】:2016-05-21 07:28:57
【问题描述】:
我正在运行 ServiceFabric 的第一个示例(预览版 1.4.87):https://azure.microsoft.com/en-us/documentation/articles/service-fabric-create-your-first-application-in-visual-studio/,以创建有状态服务,虽然示例运行正常,但我没有看到 ETW 输出日志信息诊断窗口。
对日志的调用是针对ServiceEventSource.Current.ServiceMessage(...),但是当此方法(在ServiceEventSource.cs 中实现)运行时,对this.IsEnabled() 的调用返回false,因此不会写入任何诊断信息。如果我在调试中绕过IsEnabled() 调用,仍然没有任何内容写入诊断窗口,它只包含应用程序的启动消息。
Diagnostics 中配置的提供程序是默认提供程序:
Microsoft-ServiceFabric-Actors
Microsoft-ServiceFabric-Services
cbd93bc2-71e5-4566-b3a7-595d8eeca6e8:5:0x4000000000000000
我已将 Microsoft-ServiceFabric 添加到此列表中,但这只是让我获得更多日志记录,但仍然不是我的输出消息。
我还运行了 PerfView,然后查看了可用的提供程序,上面的前两个不存在:Microsoft-ServiceFabric-Actors 和 Microsoft-ServiceFabric-Services。
有什么想法吗?这似乎是纯粹的 ETW 问题或设置中的某种 ServiceFabric 错误,诊断窗口中的提供程序规范可能不正确。
我正在运行 Win10,VS2015 Enterprise x64。
[编辑]
Program.cs 中的调用ServiceEventSource.Current.ServiceTypeRegistered(Process.GetCurrentProcess().Id, typeof(MyStatefulService).Name) 也不会写出任何内容。我收到的唯一消息是:
Service Created: Service fabric:/MyApplication/MyStatefulService partition 9505f2b3-dee5-4ea7-96b7-c861407b5283 of ServiceType MyStatefulServiceType created in Application fabric:/MyApplication ApplicationType MyApplicationType.
RunAsync has been invoked for a stateful service replica. Application Type Name: MyApplicationType, Application Name: fabric:/MyApplication, Service Type Name: MyStatefulServiceType, Service Name: fabric:/MyApplication/MyStatefulService, Partition Id: 9505f2b3-dee5-4ea7-96b7-c861407b5283, Replica Id: 130996049833056865",
The Resource Balancer completed the Creation phase and consequently issued the action -- Add on Service -- fabric:/MyApplication/MyStatefulService Partition -- 9505f2b3-dee5-4ea7-96b7-c861407b5283 with (if relevant) SourceNode -- N/A and TargetNode -- Node.2.
(对其他节点重复)
【问题讨论】:
-
您有没有想过如何让它们在 PerfView 中可见?我在那个应用程序中也遇到了这个问题。