Where Are IIS Log Files Located? How to View IIS Logs on Windows & Azure

Matt Watson Developer Tips, Tricks & Resources, Live Queue Leave a Comment

Not sure where your IIS log files are located? No problem!

For a standard Windows Server, the default log location is: %SystemDrive%\inetpub\logs\LogFiles

If your IIS logs are not stored in the default location, follow these directions below to look up where they are currently being stored. We also have directions below for Azure App Services & Cloud Services.

Where Are IIS Log Files Located for IIS 7.0+?

1. From Windows Start, run “inetmgr” or go to Administrative Tools -> Internet Information Services (IIS) Manager

2. In the left-hand tree menu, click on “Sites” to show the list of sites on the right side. IIS saves your logs based on your site ID number. So be sure to take note of your site ID for later.

3. Click on your site within the tree view or double click on it within the grid view on the right side. Double click on the Logging icon to open the logging settings screen.

4. On the logging settings screen, you can find where your IIS log files are located in the Directory field.

5. Navigate to the IIS log files location listed in the directory field. Withing the folder, you will find subfolders for each site configured with IIS. The logs are stored in folders that follow a naming pattern like W3SVC1, W3SVC2, W3SVC3, etc. The number at the end of the folder name corresponds to your site ID mentioned in step #2 above. For example, W3SVC2 is for site ID 2.

Where Are IIS Log Files Located for Azure App Services?

If you are using Azure App Services, you know that they are very different than using and managing your own Windows Server. For Azure App Services you have first to ensure that web server logging is enabled. If it is set to save to the file system, the files can be located under D:\home\LogFiles\http\RawLogs via the KUDU console.

We have a great blog post dedicated to all of the log files for your Azure App Service. Be sure to read this blog post to learn more: Where to Find Azure App Service Logs for Your App, IIS, FRT, etc

Where Are IIS Log Files Located for Azure Cloud Services?

Azure Cloud Services automatically save your IIS log files. Unlike App Services, you do not have to enable IIS logging.

To access your log files, you will need to use Remote Desktop to connect to an individual server. The files are stored in a weird file path similar to the one shown here:

C:\Resources\directory\{some random guid}.{app name}.DiagnosticStore\LogFiles\Web\W3SVC{random number}

How to View IIS Log Files Across All Servers

If you need to view IIS logs across all of your application instances, you will want to use a log management system, like Retrace. This allows you to aggregate all of your logs together in one centralized location. You can then easily search across all of them and archive them per your company policies.

Your IIS logs can be very valuable for troubleshooting web traffic trends and as a security audit log. It is critical data that every development team should have access to and archive for a period.

 

About Matt Watson

Matt is the Founder & CEO of Stackify. He has been a developer/hacker for over 15 years and loves solving hard problems with code. While working in IT management he realized how much of his time was wasted trying to put out production fires without the right tools. He founded Stackify in 2012 to create an easy to use set of tools for developers.