Microsoft Internet Information Services Log Rotation program.
- Autodetects installed IIS services and file logging settings
- Compress files older than N-days
- Delete files older than N-days
- Default settings can be overridden per-site
- Reports in Windows Event Log
- Simulation mode (or what if...) can be used
- IIS 5.0
- IIS 5.1
- IIS 6.0
- IIS 7.0
- IIS 7.5
- IIS 8.0
- IIS 8.5
- IIS 10.0
- HTTP
- FTP
- SMTP
- NNTP
Web Management Service (WMSvc) logs are not yet supported.
- Microsoft .NET Framework 4.8
- Windows Server 2008 / Vista only: IIS 6 Metabase Compatibility feature
- Administrator rights (because of WMI and IIS Metabase readings)
- Extract the program to a local folder
- Execute
IisLogRotator.exe /sto see what logfiles will be compressed or removed - Execute
IisLogRotator.exeto compress or delete logfiles definitively
If you need to execute the program daily and have reports to Windows Event Log, you should register it to Windows Task Scheduler.
- Execute
install.cmdwith Administrator rights - Modify scheduled task named
IIS Logs Rotationmanually if not satisfied with default settings (every day at 1:00 am UTC) - Enable scheduled task named
IIS Logs Rotationmanually, or executeSCHTASKS /Change /TN "IIS Logs Rotation" /ENABLE
- To remove everything, execute
uninstall.cmdwith Administrator rights - To disable the scheduled task, disable Windows scheduled task named
IIS Logs Rotation, or executeSCHTASKS /Change /TN "IIS Logs Rotation" /DISABLE
Open the IisLogRotator.config file with an XML-aware editor (like Visual Studio Code, Sublime Text) to avoid errors.
Default settings are set on the /configuration/rotation/defaultsSettings XML node.
Example for compression after 7 days, and deletion after 2 years :
<rotation>
<defaultSettings compress="true" compressAfter="7" delete="true" deleteAfter="730"/>
</rotation>To specify site-specific settings, you have to find its service code and ID,
then add to your settings in a siteSettings/siteSettings node with the ID set to the id attribute.
Example for W3SVC1 Website settings, to do deletion only after 30 days :
<rotation>
<defaultSettings compress="true" compressAfter="7" delete="true" deleteAfter="730"/>
<siteSettings>
<siteSettings id="W3SVC1" compress="false" delete="true" deleteAfter="30"/>
</siteSettings>
</rotation>| Attribute | Values |
|---|---|
enableEventLog |
true to enable Windows event log reports or false (default) to disable |
Windows event logs reports are enabled when the program is installed using install.cmd and should not be enabled without,
or Windows will complain about missing event log source identifier.
| Attribute | Values |
|---|---|
compress |
true to enable compression or false to disable |
compressAfter |
Number of days (must be greater than zero) |
delete |
true to enable deletion or false to disable |
deleteAfter |
Number of days (must be greater than compressAfter if delete and compress are true) |