我正在运行ServiceFabric的第一个示例(预览版本1.4.87):https://azure.microsoft.com/zh-cn/documentation/articles/service-fabric-create-your-first-application-in-visual-studio/,以创建一个有状态服务。虽然示例程序运行正确,但在诊断窗口中看不到ETW输出日志信息。调用log是通过
我已经将 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) 也没有写出任何东西。我唯一拥有的消息是:
ServiceEventSource.Current.ServiceMessage(...)
来实现的,但当执行该方法(在ServiceEventSource.cs中实现)时,调用this.IsEnabled()
返回false,因此没有写入诊断信息。如果在调试中绕过IsEnabled()
调用,则仍然没有将任何内容写入诊断窗口,只包含应用程序的启动消息。在诊断中配置的提供者是默认的。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.
< p > < em > (对于其他节点,重复上述步骤)