1

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)

1 Answer 1

2

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
8
  • 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?
    – Thomas
    Jul 21, 2022 at 12:28
  • 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.
    – harrymc
    Jul 21, 2022 at 12:41
  • 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)
    – Thomas
    Jul 21, 2022 at 12:44
  • 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.
    – harrymc
    Jul 21, 2022 at 12:48
  • 1
    tnx. accepted your answer. I wonder only if microsoft doesn't run into the same problems.......at least if they use IIS for their own web servers ..... but that is already too off topic fo rhere.
    – Thomas
    Jul 21, 2022 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.