IIS 10 per minute log rollover

172 Views Asked by At

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?

1

There are 1 best solutions below

1
YurongDai On

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