C# 企业库3.1滚动平面文件侦听器问题
2011年4月14日更新: 在谈到4.1版中的企业库支持时,添加了一个选项,以修复使用模拟时滚动平面文件跟踪侦听器的问题。我正在为我的web服务使用模拟,但我正在使用企业库3.1: 摘自EntLib的文档 4.1(记录应用程序块中的更改) “添加:配置支持到 选择退出模拟还原 已添加默认设置。此 修复滚动平面文件跟踪 在Web中使用侦听器时出现问题 应用程序和何时启用模拟 已启用。选择退出 模拟还原默认模式, 开创新局面 将模拟属性还原为 false。默认设置为true。 这支持配置支持, 设计时支持和可管理性 支持(WMI和组策略)。” =================================================================================================================== 目前,我有一个WCF web服务记录对其方法参数的所有调用。当web服务上的流量过大时,日志记录会完全停止,在滚动到新的日志文件时会出现以下错误。预计流量会很大。错误详细信息如下所示 配置: 在Windows Server 2008 IIS 7.5中运行的WCF Web服务 使用Enterprise Library 3.1进行日志记录。C# 企业库3.1滚动平面文件侦听器问题,c#,enterprise-library,C#,Enterprise Library,2011年4月14日更新: 在谈到4.1版中的企业库支持时,添加了一个选项,以修复使用模拟时滚动平面文件跟踪侦听器的问题。我正在为我的web服务使用模拟,但我正在使用企业库3.1: 摘自EntLib的文档 4.1(记录应用程序块中的更改) “添加:配置支持到 选择退出模拟还原 已添加默认设置。此 修复滚动平面文件跟踪 在Web中使用侦听器时出现问题 应用程序和何时启用模拟 已启用。选择退出 模拟还原默认模式, 开创新局面 将模拟属性还原为 false。默认设置为true。 这支持配置支持, 设计
<add fileName="D:\Logs\trace.log" rollSizeKB="1000" timeStampPattern="yyyy-MM-dd"
rollFileExistsBehavior="Increment" rollInterval="Day" formatter="Text Formatter"
header="----------------------------------------"
footer="----------------------------------------"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
traceOutputOptions="None"
type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
name="Rolling Flat-File Listener" />
错误:6352:时间戳:
2011年4月8日晚上11:30:45消息:追踪
记录源“跟踪”失败。
其他来源的处理将被取消
持续见摘要信息
下面是更多信息。应该
此问题持续存在,请停止服务
并检查配置文件
查看中可能出现的错误
类别和类别的配置
下沉
企业图书馆综述
分销商服务:
==========================================
例外信息详细信息:
======================================================异常类型:
System.NullReferenceException消息:
对象引用未设置为
对象的实例。数据:
System.Collections.ListDictionaryInternal
目标地点:无效
PerformRoll(System.DateTime)帮助链接:
空源:
Microsoft.Practices.EnterpriseLibrary.Logging
StackTrace信息详细信息:
========================================================================在
Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener.StreamWriterRollingHelper.PerformRoll(日期时间
rollDateTime)在
Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener.StreamWriterRollingHelper.RollifEssentials()文件
在
Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener.TraceData(TraceEventCache
eventCache,字符串源,
TraceEventType事件类型,Int32 id,
对象数据)在
Microsoft.Practices.EnterpriseLibrary.Logging.LogSource.TraceData(TraceEventType
eventType,Int32 id,日志条目
日志条目,TraceListenerFilter
traceListenerFilter)在
Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter.ProcessLog(LogEntry
日志)
配置的一部分。我有5个日志error.log、general.log、trace.log、params.log、performance.log所有配置都是这样的。
<add fileName="D:\Logs\trace.log" rollSizeKB="1000" timeStampPattern="yyyy-MM-dd"
rollFileExistsBehavior="Increment" rollInterval="Day" formatter="Text Formatter"
header="----------------------------------------"
footer="----------------------------------------"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
traceOutputOptions="None"
type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
name="Rolling Flat-File Listener" />
您能发布配置吗?这是配置的一部分。正如我提到的,只有当web服务上的流量很大时才会发生这种情况。我目前在trace.log中大量记录日志,也许我需要将一些日志移到其他日志中。