gpt4 book ai didi

wcf - 如何限制 WCF 日志记录

转载 作者:行者123 更新时间:2023-12-01 00:03:44 25 4
gpt4 key购买 nike

我们在应用程序中使用了许多 WCF 服务,我们发现日志记录非常有用,但文件往往增长得相当快。事实上,我们通常只能玩一个服务 10 分钟左右,直到日志文件超过 10mb 并且加载太慢。

无论如何将日志记录限制为仅 1000 个条目,或使用滚动文件等?

最佳答案

您可能有兴趣查看以下跟踪监听器:

  • The Code Project: A Rolling XmlWriterTraceListener

  • Ever had the problem of growing svclog files after configuring tracing in a productive WCF environment? Did not want to restart the application just for deleting or moving the trace files?

    Then, you will like the RollingXmlWriterTraceListener, which is a specialized XmlWriterTraceListener, and is completely compatible with the WCF tracing facility.

    关于wcf - 如何限制 WCF 日志记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2354427/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com