You can locate and view the access logs for websites hosted on a Windows Server using Internet Information Services (IIS). This allows you to monitor visitor activity, identify requested URLs, and troubleshoot issues related to web traffic.
Before you begin
You will need:
Administrator access to the Windows Server.
Knowledge of the specific website's name or the physical path where the site's content is hosted.
Locate the IIS Access Logs
The location of the logs depends on how the site was configured during setup. Most commonly, they are stored in the directory associated with the website's physical path.
Open IIS Manager on the Windows Server.
In the Connections pane, expand the server node and select the Sites folder.
Select the specific website for which you need to view logs.
In the Actions pane (on the right), click Explore. This opens the Windows File Explorer at the site's root directory.
Navigate to the
\logsfolder within that directory.Locate the
.logfiles. These files are typically named based on the date (e.g.,W3EC01012023.log).
Note: If the logs are not in the root directory's \logs folder, they may be located in a custom path defined in the site's configuration. You can verify this by selecting the site in IIS Manager and opening the Basic Settings or checking the Logging icon in the IIS Manager view.
Read the Access Logs
IIS logs are plain text files, but they are formatted for machine processing.
Right-click the desired
.logfile and select Open with.Choose Notepad or a similar text editor.
Review the columns. A standard IIS log entry includes:
Date and Time: When the request was made.
s-hostname: The domain name or IP address of the visitor.
cs-method: The request method (e.g.,
GETorPOST).cs-uri-stem: The specific path requested (e.g.,
/index.html).cs-uri-query: Any parameters passed in the URL.
cs-host: The host header.
cs-_method: The method used.
sc-status: The HTTP status code (e.g.,
200for success,404for not found).time-taken: The time taken to process the request in milliseconds.
If you cannot find any logs in the folder
If the \logs folder is empty or does not exist, the logging feature may be disabled for that specific site.
Open IIS Manager.
Select the website in the Connections pane.
Double-click the Logging icon in the IIS section.
Ensure that Log directory is set to a valid path and that the Log file field is not blank.
Click Apply in the Actions pane.
Limitations
The content of the logs depends on the logging fields enabled in the IIS configuration. If specific information (such as the client's IP address) is missing, it may be because those specific fields were disabled in the IIS Logging configuration.
