11

I have a strange issue with a Windows Server 2008 R2 running IIS: HTTP logging stopped a few months ago (I just found out), and I cannot seem to get it to start logging again.

I have both HTTP Logging and Logging Tools installed (under Web Server/ Health and Diagnostics) and under IIS Manager > Logging, it is enabled (One log per: Site, Format: W3C, Directory: "%SystemDrive%\inetpub\logs\LogFiles", etc. - all default stuff).

Yet under C:\inetpub\logs\LogFiles\W3SVC1 / W3SVC2avalanche, etc., all files are months old.

I have also restarted the server, to no avail.

I tried to disable logging and then enable it again (in IIS Manager), but that did not help.

Lastly, I tried to enable via command-line (even though already enabled):

C:\Windows\System32\inetsrv>appcmd set config /section:httpLogging /dontLog:False /selectiveLogging:LogAll

Applied configuration changes to section "system.webServer/httpLogging" for "MACHINE/WEBROOT/APPHOST" at configuration commit path "MACHINE/WEBROOT/APPHOST"

What I am missing??

Liam
  • 77
  • 1
  • 1
  • 12
Jim Balo
  • 270
  • 2
  • 4
  • 13
  • Have you verified that permissions are still good? How about the file system space? –  Jun 06 '14 at 16:40
  • @kce Disk space is fine. Re. folder permissions, I am not 100%: I just gave IIS_IUSRS Full Control to C:\inetpub\logs and restarted the site, but that did not help. What should the permissions be (and on what specific folders are you supposed to set them - just the logs folder?)? – Jim Balo Jun 06 '14 at 17:35
  • 3
    I got this working. In the event log, I found this: "Owner of the log file or directory C:\inetpub\logs\LogFiles\W3SVC2\u_ex140606.log is invalid. This could be because another user has already created the log file or the directory." So I checked the owner of the logs folder, etc., and for some reason it was set to "Trusted Installer" instead of what it should have been: C:\inetpub\logs should be owned by SYSTEM and its sub folders owned by the Administrators group. After fixing this, it started working. – Jim Balo Jun 07 '14 at 01:46
  • @JimBalo it would be good to convert this to an answer to make it easier to see. – spuder Oct 06 '15 at 22:06

4 Answers4

5

I know this is an old post (I'm a necromancer)! I found my way here in desperation via Google, and I believe that, at least on our server, the problem was that the "W3C Logging Service" in services.msc was stopped. Upon restarting it, the service worked fine (provided the proper folder permissions were in place, as described above). It appears that the problem our GMT -08:00 server ran into was this one:

https://support.microsoft.com/en-us/help/2982169/w3c-logging-service-crashes-in-iis-8.5-on-a-server-in-windows-8.1-or-windows-server-2012-r2

There is an update able to be downloaded within. Hope this helps someone.

Chaim Eliyah
  • 193
  • 1
  • 8
4

Check you permission on log file folders. IIS will not write to folders owned by certain groups, such as users.

The folder should be owned by "Administrators" or "SYSTEM".

Zamicol
  • 191
  • 1
  • 10
1

The Logging feature is managed in IIS UI on 3 levels: machine, site, application.

I had it enabled on the machine level, disabled on the site level (Default Web Site) level, and enabled on the the application level.

Once I enabled it (in the Actions pane on the right side) for the site, it started working.

1

When I come across the issue I delete the W3SVC1 folder and browse to the site so that IIS creates a new W3SVC1 folder with the correct SYSTEM owner and permissions.

Mike Poole
  • 151
  • 5
  • This is basically the answer @Zamicol has but another solution. If you do not wish to delete the current folder(s), simply edit the owner by right-clicking the folder-> Properties->Security->Advanced, click change next to owner, and enter "system" as the object name. – Rojo Jun 15 '21 at 02:28