Overwriting IIS logs

Posted on 2009-12-17
Last Modified: 2012-05-08
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.
Question by:wannabecraig
    LVL 17

    Accepted Solution

    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.
    LVL 31

    Expert Comment

    by:James Murrell
    LVL 2

    Assisted Solution

    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

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    What is an ISAPI filter?   •      It's an assembly (.dll file) that can add or change the way IIS works.   •      They can be enabled globally for your web server or on a site-by-site basis.   When the IIS server receives a request, enabling the ISAPI fi…
    Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now