How to Clean an IIS Log

By Lysis

Cleaning or clearing the Internet Information Services (IIS) log is an easy task, but some administrators run into an obstacle when trying to delete old logs from the directory. The files are locked by the running IIS service, so when administrators try to access them, the operating system reports an error that the files are in use. Whether you want to delete entire files or simply clean lines of text, there are only a few steps to take to gain access and unlock the files.

Step 1

Click the Windows "Start" button and select "All Programs." Select "Administrative Tools" and choose "Internet Information Service."

Step 2

Right-click the IIS server name and select "Stop." This stops the IIS service and unlocks the files for use. When stopping IIS services, users are no longer able to view web pages on your domain, so ensure that this is done during maintenance hours.

Step 3

Double-click "My Computer" on your desktop. Navigate to the directory "c:\winnt\system32\logfiles\w3svc1\." If you have configured your server to save logs to another directory, then navigate to it instead.

Step 4

Delete the .log files contained in the directory. This cleans the entire log. If you want to edit files, you can edit the text instead.

Step 5

Go back to the IIS console opened from step one. Right-click on the server name and select "Start." This restarts the IIS service and web pages are served again.

References & Resources