You'll have to run a scheduled task to do it. Voici a Powershell script that should work.
set-location c:\windows\system32\Logfiles\W3SVC1\ -ErrorAction Stop
foreach ($File in get-childitem -include *.log) {
if ($File.LastWriteTime -lt (Get-Date).AddDays(-30)) {
del $File
}
}
Cela devrait purge anything that was dernier modified more than 30 days ago. Changez le path in le premier line to wherever votre log files are stored. Also changez le -30 to however long you want to retain le files. -30 means you will delete anything older than 30 days.
Vous pouvez have a look at this article that shows différent properties for le FileInfo object si you ne want to use LastWriteTime.