[英]WCF basicHttpBinding Setting Credential hosted in Windows service
[英]Find peak requests per minute, Windows Service-hosted WCF basicHttpBinding endpoint
我們有一個Windows服務,該服務承載WCF basicHttpBinding端點。
我們想在高峰流量時每分鍾分析到此端點的傳入HTTP請求。
到目前為止,我們僅有的日志記錄是WCF消息日志記錄,它解析起來非常冗長且繁瑣。
回顧過去,我們如何輕松地打開一些輕量級的HTTP日志記錄,該日志記錄可用於分析每分鍾傳入的HTTP請求?
使用活動跟蹤並關閉logEntireMessage
,然后應該只包含一個標題條目。
logEntireMessage: By default, only the message header is logged but if we set it to true, the entire message including message header as well as body will be logged.
<system.serviceModel>
<diagnostics>
<messageLogging
logEntireMessage="false"
logMalformedMessages="false"
logMessagesAtServiceLevel="true"
logMessagesAtTransportLevel="false"
maxMessagesToLog="3000"
maxSizeOfMessageToLog="2000"/>
</diagnostics>
</system.serviceModel>
http://www.codeproject.com/Articles/420538/Simple-Steps-to-Enable-Tracing-in-WCF
然后使用服務跟蹤查看器檢查日志文件。
https://msdn.microsoft.com/zh-CN/library/ms732023(v=vs.110).aspx
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.