简体   繁体   English

有没有办法从System.Net跳过日志记录十六进制表单?

[英]Is there a way to skip logging hex form from System.Net?

I've enabled System.Net logging in application configuration and problem is, that xml messages in log file look like this: 我在应用程序配置中启用了System.Net日志记录,问题是日志文件中的xml消息如下所示:

System.Net Verbose: 0 : [7148] 00000000 : 3C 73 3A 45 6E 76 65 6C-6F 70 65 20 78 6D 6C 6E : <s:Envelope xmln 
System.Net Verbose: 0 : [7148] 00000010 : 73 3A 73 3D 22 68 74 74-70 3A 2F 2F 73 63 68 65 : s:s="http://sche

which makes it very hard to read (as long as I don't need hex representation, and textual representation is several symbols wide). 这使得它很难阅读(只要我不需要十六进制表示,并且文本表示是几个符号宽)。 Is there a way to tell .net to skip hex part? 有没有办法告诉.net跳过十六进制部分?

Set the tracemode to protocolonly as explained in the documentation : 按照文档中的说明将tracemode设置为protocolonly

<source name="System.Net" tracemode="protocolonly" maxdatasize="2048">
    <listeners>
        <add name="MyLog" />
    </listeners>
</source>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM