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.
You could try temporarily changing the log file rollover settings, as described here:
Once the logs have rolled over, revert to your previous settings.
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