Stackify is now BMC. Read theBlog

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

By: mwatson
  |  March 14, 2024
Where Are IIS Log Files Located? How to View IIS Logs on Windows & Azure

Discover where IIS log files are located on both Windows servers and Azure. This guide offers a step-by-step tutorial on how to locate and view your IIS logs, ensuring efficient troubleshooting and security audits.

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 10.0+ and Later?

IIS has seen various updates since 7.0, but the fundamental process of accessing logs remains similar. Here’s how you can access the logs for IIS 10.0 and later versions:

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.

image

3. Select your site from the tree view or double-click on it within the grid view on the right side. Then double-click the Logging icon to access the logging settings screen.

image

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 specified in the directory field. Within the folder, you’ll find subfolders for each site associated with IIS. The logs reside in folders with names like W3SVC1, W3SVC2, W3SVC3, etc. The folder name’s ending number matches the site ID highlighted in step #2. For instance, W3SVC2 pertains to 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 store your IIS log files, eliminating the need to activate IIS logging manually.

To access these logs, use Remote Desktop to connect to an individual server. The logs are located in a unique path resembling:

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 tool aggregates logs into a centralized location, streamlining searches and archiving according to organizational policies.

IIS logs are invaluable resources for diagnosing web traffic patterns and performing security audits. It’s vital that development teams access and archive these logs consistently.

Making the Most of Your IIS Logs:

When dealing with IIS logs, it’s crucial to ensure the integrity and accessibility of the data they contain. One way to safeguard against potential data loss is by regularly backing up your IIS logs. This routine not only offers peace of mind but is especially beneficial when you’re troubleshooting recurring issues. Having a historical dataset can shed light on patterns and anomalies that might be harder to spot with a limited set of recent logs.

Another essential aspect of working with IIS logs is understanding the messages within. Familiarizing oneself with the common IIS error codes is invaluable. By having a good grasp of these codes, you can speed up your troubleshooting process significantly. Instead of wading through countless lines of logs trying to decipher their meaning, you’ll be able to pinpoint issues with greater accuracy, ensuring swift resolutions.

Lastly, for those still operating on older versions of IIS, it’s worth considering an upgrade. Versions prior to IIS 10.0 might be missing out on enhanced features, vital security updates, and performance improvements. Staying updated not only means better functionality but also ensures that you’re benefiting from the latest security patches, minimizing vulnerabilities.

Improve Your Code with Retrace APM

Stackify's APM tools are used by thousands of .NET, Java, PHP, Node.js, Python, & Ruby developers all over the world.
Explore Retrace's product features to learn more.

Learn More

Want to contribute to the Stackify blog?

If you would like to be a guest contributor to the Stackify blog please reach out to [email protected]