Now that the IIS Advanced Logging is dead I am stuck with IIS 10. Is there a way to get the Enhanced Logging to rollover its log every minute? We've used this to determine performance on our servers in near real-time. Now the best rollover option is once an hour. Is there anything I can do outside of writing a custom logging module?
Asked
Active
Viewed 83 times
1 Answers
1
Basically, for performance reasons, logs are buffered and written at these predefined intervals. If these default rollover options are not what you want, you can try to force all entries in the log buffer to be written from the buffer to the log file, here is the command to flush the IIS buffer immediately:
Run cmd as administrator:
cd C:\Windows\System32
netsh http flush logbuffer
You can loop it using a batch file, the following example .bat file refreshes the log file every minute: (the method is mentioned in this thread.)
@echo off
:loop
netsh http flush logbuffer
timeout /t 60 > NUL
goto loop

YurongDai
- 1,362
- 1
- 2
- 7
-
I did find that method else where and it does solve the issue with log data being up to date. The issue it doesn't solve is the once every minute rollover. With the once per minute rollover you get a new file every minute. I'd have to modify my code to read on the whole file and parse out only what happened in the most recent minute. That is my last resort solution. Thanks for the advice that method will definitely be part of the solution. – Agile Noob Oct 10 '22 at 14:54