I've had a problem with my IIS that I could only log daily: Why does the IIS only write logs once per day?
The answer helped a lot, BUT I've run into a problem with it. In essence: I manage to configure it so that I get up to hourly logs. But when I say "create no new file" to get a continuous stream of logfile entries.......the file is created and stays at 0 bytes. After 30 minutes I changed back to hourly and.....suddenly the file got 300 KB of data into it.
Thus my question is, how can I get the IIS to log continuously in a permanent stream, so that every new log entry is immediately written into the logfile?
IIS Version: (10.0.14393.0)
The command to immediately flush the IIS buffer is :
netsh http flush logbuffer
You may loop over it using a batch file.
The following example .bat
file flushes the log file every second:
@echo off
:loop
netsh http flush logbuffer
timeout /t 1 > NUL
goto loop
External links referenced by this document: