Immediately flush IIS log for real time tail to avoid 60 second buffer delay Aug 15, 2013

I wanted to tail my IIS log in realtime to avoid having to wait 60 seconds as is the default on IIS 7. I found out that I could run the command

> netsh http flush logbuffer

This is great but I wanted to do a tail so this short script does the trick for you (I assume you have cygwin installed if you’re on Windows)

Run command every second in the background and flush output (the “Ok.” message)

$ while true; do netsh http flush logbuffer > /dev/null; sleep 1; done &

Then you’re able to do your regular tail

$ tail -100f u_ex130814.log

and have it update in real time.