General Computing
Updated Fri, 07 Oct 2022 00:11:30 GMT

IIS How can I produce a continuous log stream?

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
  netsh http flush logbuffer
  timeout /t 1 > NUL
goto loop

Comments (5)

  • +0 – so that I get it right: regardless waht I do...for examlpe if I put it down as daily logs, if I want a continuous stream I don't have any configuration option any longer, but instead need to flush the buffer manually? — Jul 21, 2022 at 12:28  
  • +0 – That will get a log that is up to date to the second, and you don't need to force IIS to do something that it's not designed to do. — Jul 21, 2022 at 12:41  
  • +0 – Is there any known reason as to why a continuous log is no longer configurable? (in the way older versions I used in the past it was default that it wrote the logs either immediately or with 1-2 minutes delay not "only" when he creates a new file) — Jul 21, 2022 at 12:44  
  • +0 – Microsoft changes stuff with every new version and we must adapt. It seems like "create no new file" doesn't work any more. You can do a bug report using the Feedback Hub, and maybe this will be fixed in the future. — Jul 21, 2022 at 12:48  
  • +1 – tnx. accepted your answer. I wonder only if microsoft doesn't run into the same least if they use IIS for their own web servers ..... but that is already too off topic fo rhere. — Jul 21, 2022 at 13:01  

External Links

External links referenced by this document: