401

I'm trying to set up an application from a third party, which requires a supporting website hosted in my local IIS. I've created a website exactly as explained in their install guide, but am having some problems, and would like to see what the IIS log has to say. Embarrassingly enough, the problem is I can't find the log files!

So my question is: Where does IIS7 store logs by default?

0

11 Answers 11

571

I think the default place for access logs is

%SystemDrive%\inetpub\logs\LogFiles

Otherwise, check under IIS Manager, select the computer on the left pane, and in the middle pane, go under "Logging" in the IIS area. There you will se the default location for all sites (this is however overridable on all sites)

You could also look into

%SystemDrive%\Windows\System32\LogFiles\HTTPERR

Which will contain similar log files that only represents errors.

7
  • 2
    Thanks, this seems logical, but the logs directory is empty. I probably need to turn on logging somehow, but I can't find anything about logging in the middle panel in IIS Manager.
    – Kjartan
    Commented Jun 21, 2011 at 14:04
  • 81
    If you don't find it, it isn't installed. You need to fire up Programs and Features then click on Turn Windows features on or off on the left side then select Internet Information Services\World Wide Web Services\Health and Diagnostics\HTTP Logging
    – jishi
    Commented Jun 21, 2011 at 14:14
  • You can check how it is configured on your computer this way: portal.smartertools.com/kb/a2487/…
    – mauryat
    Commented Jul 31, 2014 at 20:37
  • 4
    I believe the latter path (...\HTTPERR) is the place where log files generated by http.sys land by default, not log files from IIS itself. See: technet.microsoft.com/en-us/library/cc784703%28v=ws.10%29.aspx Commented Jan 5, 2016 at 22:07
  • 7
    This logs are useless if you are looking for error message. Commented Mar 26, 2018 at 14:00
123

I believe this is an easier way of knowing where your IIS logs are, rather than just assuming a default location:

Go to your IIS site, e.g. Default, click on it, and you should see "Logging" to the right if logging is enabled:

enter image description here

Open it and you should see the folder right there:

enter image description here

You are welcome!

2
  • 11
    On IIS10 the 'Logging' feature requires that at least the World Wide Web Services -> Health and Diagnostics -> HTTP Logging windows feature is installed. Otherwise it will not show up. Commented Oct 5, 2017 at 13:12
  • Any what if the Logging icon doesn't appear? I can't find my log files locally - none of the paths seem to exist on my machine.
    – Andy
    Commented Mar 27, 2018 at 20:12
117

I'm adding this answer because after researching the web, I ended up at this answer but still didn't know which subfolder of the IIS logs folder to look in.

If your server has multiple websites, you will need to know the IIS ID for the site. An easy way to get this in IIS is to simply click on the Sites folder in the left panel. The ID for each site is shown in the right panel.

Once you know the ID, let's call it n, the corresponding logs are in the W3SVCn subfolder of the IIS logs folder. So, if your website ID is 4, say, and the IIS logs are in the default location, then the logs are in this folder:

%SystemDrive%\inetpub\logs\LogFiles\W3SVC4

Acknowlegements:

  • Answer by @jishi tells where the logs are by default.
  • Answer by @Rafid explains how to find actual location (maybe not default).
  • Answer by @Bergius gives a programmatic way to find the log folder location for a specific website, taking ID into account, without using IIS.
1
  • 4
    I found the ID by clicking on advanced settings in the Actions Panel after selecting the site in the Connections panel.
    – Stagg
    Commented Aug 15, 2017 at 8:50
21

The 100% correct answer for the default location of the log files is...

%SystemDrive%\inetpub\logs\LogFiles

Yes you can enter this into the explorer address bar it'll work.

To be 100% sure, you need to look at the logging for the web site in IIS.

https://learn.microsoft.com/en-us/iis/get-started/whats-new-in-iis-85/enhanced-logging-for-iis85

i.e.

  1. Open IIS Manager.
  2. Select the site or server in the Connections pane,
  3. Double-click Logging.
  4. The location of log files for the site can be found within the Directory field

EDIT: As pointed out by Andy in the comments below you need to ensure when installing IIS that you elected to enable HTTP logging, otherwise HTTP logging won't be available.

Enable HTTP Logging

0
12

A much easier way to do this is using PowerShell, like so:

Get-Website yoursite | % { Join-Path ($_.logFile.Directory -replace '%SystemDrive%', $env:SystemDrive) "W3SVC$($_.id)" }

or simply

Get-Website yoursite | % { $_.logFile.Directory, $_.id }

if you just need the info for yourself and don't mind parsing the result in your brain :).

For bonus points, append | ii to the first command to open in Explorer, or | gci to list the contents of the folder.

1
  • No, wait, it's: (Get-Website * | % { $_.logFile.Directory}) Commented Aug 5, 2022 at 15:55
6

Try the Windows event log, there can be some useful information

4
  • 2
    The event log will probably have any page errors that occurs on the site.
    – jishi
    Commented Jun 21, 2011 at 13:53
  • 21
    Seems like a good idea, but there is a great deal of info here, and I can't seem to find anything relevant to IIS. Any pointer as to where in the Event Viewer to look, or how best to filter the information there?
    – Kjartan
    Commented Jun 21, 2011 at 14:15
  • 9
    -1, reason: this answer is too general. Please provide a detailed explanation where in the event log the information can be found, or how to filter for it, otherwise given the huge amount of logs in the logs in the event log its too difficult to find the relevant logs.
    – lanoxx
    Commented Jul 13, 2016 at 15:12
  • Found the cause of my issue (connection closed only on *.woff files) in Windows Logs > System (in my case a wrong SSL configuration)
    – the_nuts
    Commented Aug 26, 2019 at 13:40
4

Enabling Tracing may be a better alternative to the Windows Event Log. This gave me the information I needed to fix my own WebService.

3

I think the Default place for IIS logging is: c:\inetpub\wwwroot\log\w3svc

1

I have found the IIS Log files at the following location.

C:\inetpub\logs\LogFiles\

which help to fix my issue.

1
  • I have just provided the default path where IIS log files lie on the server. If you can read the question. It is "Where does IIS7 store logs by default?" :( Commented Jul 15, 2019 at 12:47
0

C:\inetpub\logs\LogFiles

Check the identity of the site going to sites and advanced settings

0

The simplest answer is to query like this:

(Get-Website * | % { $_.logFile.Directory});ls $GetIISLogs\W3SVC1\*

If you have more than one site you will get more than one answer, so you need to query with a 'foreach' to get the website name with the directory...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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