【发布时间】:2011-10-13 11:23:27
【问题描述】:
我正在尝试每周轮换一个日志文件,但此配置文件无法正常工作。如果我将其更改为旋转而不是从午夜到分钟,它只会记录一个持续时间为一分钟的单个文件。没有新文件正在生成。最新版本的企业库是否有任何已知的错误,专注于滚动平面文件不起作用?我目前的配置有问题吗? 谢谢!
<loggingConfiguration name="" tracingEnabled="true" defaultCategory="General"
revertImpersonation="false">
<listeners>
<add name="Rolling Flat File Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
fileName="C:\EMS\logs\MobileMessagingServices.log" footer="" formatter="Text Formatter"
header="" rollFileExistsBehavior="Increment" rollInterval="Midnight"
rollSizeKB="100000" timeStampPattern="yyyy-MM-dd hh:mm:ss" maxArchivedFiles="7"
traceOutputOptions="Timestamp, Callstack" filter="All" />
</listeners>
<formatters>
<add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
template="{timestamp} :: {category} :: {message}" name="Text Formatter" />
</formatters>
<categorySources>
<add switchValue="All" name="General">
<listeners>
<add name="Rolling Flat File Trace Listener" />
</listeners>
</add>
</categorySources>
<specialSources>
<allEvents switchValue="All" name="All Events">
<listeners>
<add name="Rolling Flat File Trace Listener" />
</listeners>
</allEvents>
<notProcessed switchValue="All" name="Unprocessed Category">
<listeners>
<add name="Rolling Flat File Trace Listener" />
</listeners>
</notProcessed>
<errors switchValue="All" name="Logging Errors & Warnings">
<listeners>
<add name="Rolling Flat File Trace Listener" />
</listeners>
</errors>
</specialSources>
【问题讨论】:
标签: c# xml logging enterprise-library