• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1690
  • Last Modified:

Overwriting IIS logs

Is there anyway I can set IIS logs on an IIS6 server to be overwritten after a certain time?  OUr server just fills up with these and we only need to keep them for a week.
2 Solutions
There is nothing in  IIS that can do this.

However you can use Steve's tool here:

to remove/move/compress them for you.

I would actually compress them first as you may need more than a week for troubleshooting some issues and delete after x days/weeks.

Logs files are plain text and will compress like 95% so you can conserve space and have enough logs if you need them.
James MurrellProduct SpecialistCommented:
we use robocopy to move our old logfiles to a backupdirectory.

so if you already know/use robocopy you could write a batch file with someting like this as a scheduled task:

robocopy c:\inetpub\logs C:\inetpub\logs\temp *.log /mov /s /minage:30
rmdir c:\inetpub\logs\temp /S /Q

the firstline says: from to whatkindoffiles moveinsteadofcopy evenfromsubdirectorys everythingolderthen:
the second line just removes the temporary directory and all files without asking

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now