我已经在Akka.NET中将Application Insights设置为日志记录提供程序,并设置Akka.Monitoring
来记录各种自定义指标(例如,对收到的消息进行计数和处理时间的计时)。这很好用。
但是我使用Akka.NET记录器生成的日志不会发送到Application Insights:
var logger = Logging.GetLogger(Context);
logger.Info($"Please send me to Azure!");
我希望可以在Application Insights的“跟踪”部分中看到它,以及其他.NET Core日志项。但是,这些日志确实出现在我的运行时输出中,我认为它是stdout。
像这样使用Akka.Monitoring.ApplicationInsights
配置Application Insights:
ActorMonitoringExtension.RegisterMonitor(system, new ActorAppInsightsMonitor(instrumentationKey));
快速扫描显示,对App Insights的唯一调用是TrackMetrics
调用。要发送类似logger.Info($"Please send me to Azure!");
的日志消息,可能需要调用TrackTrace
。因此,我想该库仅对跟踪指标有用,而对消息无用。软件包说明显示为:
Akka.Monitoring是Akka.NET的ActorSystem扩展,它公开了一个可插拔的层,用于报告性能指标从参与者返回到监视系统suc