【问题标题】:Log 4 net not logging for the same urlLog4net 没有记录相同的 url
【发布时间】:2011-10-21 12:18:22
【问题描述】:

我使用 log4net dll 为我的 WCF 服务创建了一个错误处理程序。添加到 tfs 后,我的日志记录不起作用,我还设置了配置,但日志记录没有发生,尽管在我的测试应用程序中它工作正常.请帮忙。

【问题讨论】:

  • 您能否输入您在示例应用程序和主 wcf 服务中使用的配置??

标签: .net wcf visual-studio-2010 log4net


【解决方案1】:

您可以通过在appSettings 部分的配置文件中添加以下内容来enable debugging in log4net:

<add key="log4net.Internal.Debug" value="true"/>

如文章中所述,将跟踪指向某个文件,例如:

<system.diagnostics>
  <trace autoflush="true">
    <listeners>
      <add 
        name="textWriterTraceListener" 
        type="System.Diagnostics.TextWriterTraceListener" 
        initializeData="C:\my-log4net-trace.txt" />
    </listeners>
  </trace>
</system.diagnostics>

请参阅full description over in the log4net FAQ。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-03
    • 2011-10-29
    • 2011-04-07
    • 2016-12-04
    • 1970-01-01
    相关资源
    最近更新 更多