Pcornel
Browse topics
Options
Recent
Favorites
Web Infrastructure · Technical reference

Logging

Direct answer

IIS logging writes one line per request with time, client IP, URL, status, substatus and time-taken to C:\inetpub\logs\LogFiles, in W3C format by default. HTTP.sys errors are logged separately in HTTPERR.

When to use this

Use this when reading or configuring IIS request logs.

First 30 seconds

1. Log location per site.

2. Fields include sc-status, sc-substatus, sc-win32-status, time-taken.

3. HTTPERR log for HTTP.sys rejections.

4. Rollover and retention.

5. Ship to central logging.

Operational verification

each request logged with status and timing

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Microsoft Windows
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformMicrosoft Windows
Scope / prerequisiteUse this when reading or configuring IIS request logs.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Verification path Verify boundary
# Where does a site log, and which fields?
$site = Get-IISSite -Name 'intranet'
$site.LogFile | Select-Object Directory, LogFormat, Period, LogExtFileFlags

# Last lines of today's log for site ID 2
Get-ChildItem C:\inetpub\logs\LogFiles\W3SVC2 | Sort-Object LastWriteTime | Select-Object -Last 1 | Get-Content -Tail 20

# Count status codes in a log file
Get-Content C:\inetpub\logs\LogFiles\W3SVC2\u_ex261129.log | Where-Object { $_ -notmatch '^#' } |
  ForEach-Object { ($_ -split ' ')[11] } | Group-Object | Sort-Object Count -Descending

The column index depends on the #Fields: header line of the file — read it before parsing. Log Parser or a log platform (Elastic, Splunk, Azure Monitor) is easier for large volumes.

Step 2 Troubleshooting Narrow the fault
  • No log files: logging disabled for the site, wrong directory permissions, or the request never reached IIS.
  • Disk full: logs never cleaned up — move to a data volume and add retention.
  • Need more detail for one error: enable Failed Request Tracing for that status code and URL, reproduce, then disable it.
Step 3 Common mistakes Narrow the fault
  • Logs on C: without rotation or cleanup.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • W3C fields are configurable per site.
  • time-taken shows slow requests in milliseconds.
  • HTTPERR logs requests rejected before reaching IIS.
Key checks
  • Get-Website — sites, state, bindings
  • Get-IISAppPool — application pools and state
  • Get-WebBinding — bindings
  • Get-ChildItem IIS:\SslBindings — certificate bindings
  • Get-Content C:\inetpub\logs\LogFiles\W3SVC<id>\*.log -Tail 20 — request log
ReferenceWhat it is1 section · depth on demand

Direct Answer

IIS logs each completed request per site in W3C format under inetpub\logs\LogFiles\W3SVC<id>, with UTC times, sc-status/sc-substatus, sc-win32-status and time-taken (ms). Behind a load balancer add an X-Forwarded-For custom field. Requests that never reached a site are in HTTPERR; for a deep look at one failing request use Failed Request Tracing.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
ReferenceWhy it matters1 section · depth on demand

What it is

IIS writes one log per site per day in W3C format by default, after each request completes. sc-status, sc-substatus and sc-win32-status together explain errors (for example 401.2 = no allowed authentication method). time-taken is in milliseconds and includes sending the response.

ReferenceImportant terms & boundaries2 sections · depth on demand

Settings

Get-WebConfigurationProperty -Filter system.applicationHost/sites/siteDefaults/logFile -Name directory

W3C format fields: date, time, s-ip, cs-method, cs-uri-stem, sc-status, time-taken. Add X-Forwarded-For as a custom field behind proxies.

In depth

IIS writes an access log per site, by default in W3C format, one file per day, to %SystemDrive%\inetpub\logs\LogFiles\W3SVC<siteID>. Entries are written after the request completes, and times are in UTC.

Default W3C fields worth knowing

FieldMeaning
date, timeCompletion time (UTC)
s-ip, s-portServer address and port that received the request
cs-method, cs-uri-stem, cs-uri-queryRequest
cs-usernameAuthenticated user (empty for anonymous)
c-ipClient IP — the load balancer's IP behind a proxy
cs(User-Agent), cs(Referer)Client info
sc-status, sc-substatusHTTP status and IIS substatus (e.g. 401.2, 500.19)
sc-win32-statusWindows error code for the outcome (0 = success; e.g. 64 = client disconnected)
time-takenMilliseconds, including time to send the response

Behind a load balancer

Add a custom field that logs the X-Forwarded-For request header (IIS 8.5 and later), otherwise every request appears to come from the proxy.

Other logs

  • HTTPERR (%SystemRoot%\System32\LogFiles\HTTPERR) — requests rejected by HTTP.sys before reaching a site.
  • Failed Request Tracing (FREB) — detailed per-request pipeline traces for chosen status codes or durations, in %SystemDrive%\inetpub\logs\FailedReqLogFiles.
  • Event logs — WAS and W3SVC events in System; application errors in Application.
  • ASP.NET Core stdout logs when enabled in web.config.
Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docMicrosoft Windows current

Authoritative/upstream documentation reviewed for bounded claims in IIS → Logging. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://learn.microsoft.com/en-us/iis/ · confidence 94%
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
iis logshttperr logw3c log
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

PatternMeaning
Request missing from the logIt never reached the site — HTTPERR, wrong binding, load balancer, or still in progress
High time-taken with small responsesSlow application or back end; for large responses it may be a slow client
sc-win32-status 64Client disconnected before the response completed
Many 401s followed by 200Normal Negotiate/NTLM handshake (401 challenge, then success)
All c-ip identicalBehind a proxy — log X-Forwarded-For
Timestamps off by hoursLog times are UTC
Confirmation

Confirm action

Continue?