Internet Information Services Log Rotator
Microsoft Internet Information Services Log Rotation program.
Web Management Service (WMSvc) logs are not yet supported.
IisLogRotator.exe /s
to see what logfiles will be compressed or removedIisLogRotator.exe
to compress or delete logfiles definitivelyIf you need to execute the program daily and have reports to Windows Event Log,
you should register it to Windows Task Scheduler.
install.cmd
with Administrator rightsIIS Logs Rotation
manually if not satisfied with default settings (every day at 1:00 am UTC)IIS Logs Rotation
manually, or execute SCHTASKS /Change /TN "IIS Logs Rotation" /ENABLE
uninstall.cmd
with Administrator rightsIIS Logs Rotation
, or execute SCHTASKS /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"></defaultSettings>
</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"></defaultSettings>
<siteSettings>
<siteSettings id="W3SVC1" compress="false" delete="true" deleteAfter="30"></siteSettings>
</siteSettings>
</rotation>
rotation
element allowed attribute valuesAttribute | 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.
defaultSettings
/ siteSettings
elements allowed attribute valuesAttribute | 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 ) |