wcf - WCF 跟踪添加过滤器
问题描述
我想在我的 WCF 跟踪中添加一个过滤器,以过滤端点或消息的内容。
从我所看到的如何做到这一点尚不清楚。我正在尝试在 web.config 文件中执行此操作。
欢迎任何想法。
谢谢伊恩
解决方案
请尝试以下配置,跟踪 WCF 活动。
<system.diagnostics>
<sources>
<source name="System.ServiceModel" propagateActivity="true" switchValue="Information, ActivityTracing">
<listeners>
<add type="System.Diagnostics.XmlWriterTraceListener" name="xmlLog" initializeData="myLogs.svclog"/>
</listeners>
</source>
</sources>
</system.diagnostics>
<system.serviceModel>
<diagnostics>
<messageLogging logEntireMessage="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="false"/>
</diagnostics>
</system.serviceModel>
您可以参考以下链接自定义配置。
https://docs.microsoft.com/en-us/dotnet/framework/wcf/samples/tracing-and-message-logging
https://docs.microsoft.com/en-us/dotnet/framework/wcf/diagnostics /tracing/configuring-tracing
获得跟踪文件后,我们可以使用它Microsoft Service Trace Viewer
来过滤 WCF 活动。
https://docs.microsoft.com/en-us/dotnet/framework/wcf/service-trace-viewer-tool-svctraceviewer-exe
https://docs.microsoft.com/en-us/dotnet/framework/wcf /diagnostics/tracing/using-service-trace-viewer-for-viewing-correlated-traces-and-troubleshooting
如果有什么我可以帮忙的,请随时告诉我。
推荐阅读
- groovy - 正则表达式使用 groovy 从字符串中查找子字符串
- html - 修复了 div 内的搜索栏
- azure-pipelines - 无法在 Azure Pipelines 的脚本任务中更改 PATH
- sql - SQL,使用 LIMIT 1 是否可以提高索引的性能
- postgresql - Terraform Postgres aws_db_instance enabled_cloudwatch_logs_exports 参数的有效值
- asp.net - ASP.NET - 上传/下载文件时出错
- vue.js - vue.js test-utils 如何在挂载的生命周期钩子中测试函数
- php - 如何在不输入用户名或密码的情况下验证用户身份?
- oracle - 无法通过 EXECUTE IMMEDIATE 运行 CTX_DDL.CREATE_STOPLIST
- java - Kubernetes Java 部署中未解析环境变量