Im using Microsoft.VisualBasic.Logging.FileLogTraceListener in my C# app for logging. I have set it to roll the log files daily. See my setting below:
<add name="TextListener"
type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
traceOutputOptions="DateTime,ProcessId,ThreadId"
customLocation=""
location="ExecutableDirectory"
logFileCreationSchedule="Daily"
baseFileName="TestAppLog"/>
My issue is that it simply keeps the old files in the system, so even if the daily files are small eventually it will accumulate. My ideal scenario would be to keep only the log files from the last 10 days, any thing older than that it is deleted from the system.
Is there a way to do it on the Microsoft.VisualBasic.Logging.FileLogTraceListener setting? If none, whats the best approach to implement this automatic purging of old data?