要将Trace调试日志输出到日志文件,需要在app.config配置文件下添加一下内容:

<system.diagnostics>
        <trace autoflush="true" indentsize="0">
            <listeners>
                <add name="LogListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="LogConsoleApp.log"/>
            </listeners>
        </trace></system.diagnostics>

</system.diagnostics><startup>同级。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-29
  • 2022-12-23
  • 2022-12-23
  • 2021-06-13
  • 2021-10-21
相关资源
相似解决方案