Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I often have to look at problems on live web servers, would like to know if there is a safe way to force an IIS log file rollover on a production server.

share|improve this question

3 Answers 3

up vote 1 down vote accepted

You could try temporarily changing the log file rollover settings, as described here:

http://technet.microsoft.com/en-us/library/cc754615(WS.10).aspx

Once the logs have rolled over, revert to your previous settings.

share|improve this answer

Are you sure about this, I've been supporting IIS web farms for years and had no issues with copying the current IIS log file to get all entries up to that point....(IIS 4,5,6 and 7)

How are you copying them?

share|improve this answer
    
I often use Symantect pcAnywhere to copy the files, so perhaps it's something peculiar to that program that's causing me problems. I'll edit the question slightly but I'd still like to know if there's a way to force a log file rollover, this sort of functionality is common in the UNIX world and SQL Server also has it. –  Luke Girvin Nov 19 '09 at 11:27

If you have the ability to take the server out of rotation, or you're working on a test server, then one option is to rename the current log file. IIS will then create a new one. For example, if you want to capture logs for one hour without having to filter them out of a larger file:

  • Take server out of rotation and stop IIS
  • Rename the latest log file
  • Start IIS, put server back into rotation
  • IIS creates a new log file
  • Wait one hour
  • Copy the latest log file, and you have a file with one hour of log data
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.