c# - 从生产环境获取日志
问题描述
我们有在许多客户端机器上运行的 AC# 应用程序,并且我们有非常多的代码行,如下所示:
try{exceptionalMethod();}//all type of exceptions may be throw here (system.exception,our business exceptions ,...)
catch{MessageBox.Show("Error");randomMethod();}//we don't have any log here
我们如何在生产环境的日志文件中记录所有 CLR First Chance 异常。
注意:我们不能在客户端机器上安装任何东西(如果可以,我们使用 Adplus 和 Windows 调试器,配置文件非常简单)。
但是我们可以在代码中插入最小的更改并发布新版本。
解决方案
推荐阅读
- python - numpy数组中的条件复制元素
- javascript - 使用地图排序表
- python - 在我用 SMOTE 对重新采样的数据拟合模型后,如何在 scikit 的随机森林中执行特征重要性?
- javascript - 如何通过单击容器外部来关闭此搜索栏?
- java - 在@RestController 中禁用传输编码
- filesystems - 如何在 Julia 中仅列出目录的子目录?
- c# - Json 将对象发布到 AspNetCore 不起作用
- arduino-ide - 将我在 Modbus 上收到的大端值转换为浮点值
- python - 比较两个数据框,但仅在特定列上
- python - 使用opencv在python中通过哪种算法进行人脸识别最准确的训练?