我想要的输出是,如果“rolling.log”文件是在 26-06-2012 之前创建和修改的,那么第二天(27-06-2012)该文件应该用“rolling-26-06-2012..log”重命名. 现在输出是“rolling-27-06-2012.log”文件。
以下是我当前在 web.config 文件中的日志记录设置。
<*loggingConfiguration name=""tracingEnabled="true" defaultCategory="myTestLog">
<*listeners>
<*add name="Rolling Flat File Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
fileName="C:\Project\Others\Testing\testMSLogging\rolling.log"
formatter="Text Formatter" rollFileExistsBehavior="Increment"
rollInterval="Minute" rollSizeKB="50" timeStampPattern="yyMMdd"
filter="Information" />
<*add name="Flat File Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
fileName="C:\Project\Others\Testing\testMSLogging\testMSLogging\trace.log"
formatter="Text Formatter" filter="Error" />
</listeners>
<*formatters>
<*add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
template="Timestamp: {timestamp}{newline}
Message: {message}{newline}
Category: {category}{newline}
Priority: {priority}{newline}
EventId: {eventid}{newline}
Severity: {severity}{newline}
Title:{title}{newline}
Machine: {localMachine}{newline}
App Domain: {localAppDomain}{newline}
ProcessId: {localProcessId}{newline}
Process Name: {localProcessName}{newline}
Thread Name: {threadName}{newline}
Win32 ThreadId:{win32ThreadId}{newline}
Extended Properties: {dictionary({key} - {value}{newline})}"
name="Text Formatter" />
</formatters>
<*categorySources>
<*add switchValue="All" name="myTestLog">
<*listeners>
<add name="Rolling Flat File Trace Listener" />
</listeners>
</add>
</categorySources>
<*specialSources>
<*allEvents switchValue="All" name="All Events" />
<*notProcessed switchValue="All" name="Unprocessed Category" />
<*errors switchValue="All" name="Logging Errors & Warnings">
<listeners>
<add name="Flat File Trace Listener" />
</listeners>
</errors>
</specialSources>
请任何人帮助我。非常感谢。