現在のログ ファイルに常にタイムスタンプ パターンを適用する方法はありますか?
app.config からのログ ファイル リスナーの例を次に示します。
<add name="Exception" 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="%APPDATA%\MyProgram\Logs\exception.log" formatter="PrismText"
rollFileExistsBehavior="Increment" rollInterval="Day" timeStampPattern="yyyy-MM-dd" rollSizeKB="3000"
maxArchivedFiles="10" />
最大サイズまたは日付変更に達すると、ログの名前が変更されますが、TimeStamp パターンで初期ログ ファイルを表示する方法はありますか?
これをログフォルダーに取得します:
exception.log <-- Current log
exception.2011-12-22.1.log
exception.2011.12.22.2.log
私はこれが欲しいです:
exception.2011-12-22.log (or exception.2011-12-22.1.log) <-- Current Log
exception.2011.12.22.2.log
変更/作成された日付を見るだけなので大したことではありませんが、簡単に修正できればいいのですが。