当我启用跟踪时,例如:
<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Warning">
<listeners>
<add name="_listener0" />
</listeners>
</source>
</sources>
<sharedListeners>
<add name="_listener0" type="System.Diagnostics.XmlWriterTraceListener"
initializeData="logs\ServiceModel.svclog" traceOutputOptions="DateTime, ProcessId, ThreadId, Callstack" />
</sharedListeners>
<trace autoflush="true" />
</system.diagnostics>这对应用程序性能的影响有多大?
发布于 2010-01-14 23:42:49
与大多数问题一样,答案是“视情况而定”。您是在启用WCF组件的跟踪,还是在使用自己的跟踪调用?是否附加了跟踪侦听器(例如,写入文件?或者是否打开了DebugView工具以查看系统调试控制台?你的代码是在紧密循环中大量使用跟踪,还是只对非递归函数等进行更适度的跟踪?
你可以试着看看,但对于大多数应用程序,你会注意到的。
发布于 2010-01-14 23:51:53
发布于 2010-10-26 02:35:55
如果您担心性能问题,请务必<清除/>默认侦听器。
Thoughts on System.Diagnostics Trace vs. Common.Logging
https://stackoverflow.com/questions/2065268
复制相似问题