This is a handy feature I discovered in Windows Server 2008. You can force http.sys to flush cached log entries immediately to disk. The next time you are waiting for requests to flush to your IISLogs, go to the command prompt and type
netsh http flush logbuffer
You'll see an Ok.
Then open your log files and your entries should be present.
Take care,
Steve
RSS
5 Comments
Rachit said
Good info.
I was wondering if there's any way to have IIS write the logs in multiple locations. Basically, I want to implement the real-time stats and the closest I can get using IIS logs is hourly.
Can you think of any other way (except writing my own HttpModule and every request would parse through that)?
Bill Staples said
I think this works on windows 2003 as well.... I could be wrong. The new netsh http cache commands are new to windows 2008, and those are handy if you are using kernel caching.
steve schofield said
Hi Bill. I couldn't figure out how to do this exact command on IIS6. Do you know if this is hid somewhere else?!
steve schofield said
Rachit. You would need to write your own HTTP module or ISAPI component. Check out Bill Staples example of using SQL logging with the integrated pipeline on IIS7.
http://blogs.iis.net/bills/archive/2007/05/01/building-an-iis7-sql-logging-module-with-net.aspx
http:// said
Nice time saver, thanks! Works on Vista Home Premium.