c# - C# - 将 System.Diagnostics.Tracing 跟踪导出到文本文件
问题描述
我有一个使用标准 EventSource 进行日志记录的 Service Fabric 群集应用程序。
[EventSource(Name = "SomeName")]
internal sealed class ServiceEventSource : EventSource
{
public static readonly ServiceEventSource Current = new ServiceEventSource();
[NonEvent]
public void Message(string message, params object[] args)
{
if (this.IsEnabled())
{
string finalMessage = string.Format(message, args);
Message(finalMessage);
}
}
}
我的应用程序尚未部署到 Azure,但在我的本地开发集群中运行。如果这提供了以下解决方案,则可以部署它。
我有一些单元测试,当我运行它们时,我想将跟踪导出到文本文件。
我必须与同事一起验证我的单元测试,如果我们将跟踪日志打印在纸上,这对我们来说会容易得多。
无论如何(黑客很好)可以做到这一点?也许我可以连接 Azure 服务并从那里获取数据?
从 Visual Studio 2019 中的诊断查看器复制粘贴一次只能完成 1 行。我有数百个。
有任何想法吗?
解决方案
推荐阅读
- java - 如何将 Jackson 与具有泛型类型的列表一起使用
- javascript - 仅当在 GSP (Grails) 上签入特定单选按钮时才显示元素
- javascript - CoolLightBox 多个画廊 vue.js
- ios - Testflight - 将应用程序添加到帐户/设备 A 会从帐户/设备 B 中删除应用程序
- packet - Packet Tracer 几个版本中扩展 acl 的问题
- javascript - 我正在寻找让按钮(当前居中)动画到左上角onClick,我已经有一个连接到这个元素的函数
- parsing - 语法中的reduce-reduce、shift-reduce冲突
- xml - 如何使用 XML 和 VBA 登录网站
- embedded-linux - 如何调试 Linux 启动时崩溃 (PetaLinux 2020.1)
- vb.net - 添加计时器,根据用户输入设置时间并使其成为冷却时间