Lessons in this course (9)

8. Logging, Failed Request Tracing and troubleshooting HTTP errors

Intermediate★ Must knowLesson 8 of 9

Where to look:

  1. IIS logs (C:\inetpub\logs\LogFiles\W3SVC<siteId>\) — every request with status, sub-status and Win32 status (sc-status, sc-substatus, sc-win32-status) and time-taken.
  2. Event Viewer → Windows Logs → Application/System — app crashes, ASP.NET Core startup failures, WAS pool stops.
  3. Failed Request Tracing (FREB) — enable on the site, add a rule (e.g. status 500 or time > 5 s) → detailed XML trace of every module step in inetpub\logs\FailedReqLogFiles.
  4. ASP.NET Core stdout log (stdoutLogEnabled="true", create the logs folder) and your app's own logs.
  5. Worker Processes (IIS Manager) — currently executing requests per pool.
ErrorMeaningTypical fix
401.1 / 401.2Logon failed / auth method not enabledEnable the right authentication mode; check credentials
403.14Directory listing deniedMissing default document or app not deployed
404.0 / 404.3Not found / MIME map missingWrong path; add <mimeMap> for e.g. .json, .woff2, .webmanifest
404.13Request too largeRaise maxAllowedContentLength
500.19Config errorInvalid/duplicated web.config section, missing module (URL Rewrite, ANCM), locked section
500.21Handler not recognisedASP.NET not installed or pool in Classic mode
500.30ASP.NET Core app failed to start (in-process)Startup exception — stdout log, Event Viewer, run dotnet app.dll manually
500.31 / 500.32Runtime not found / bitness mismatchInstall the right .NET runtime/Hosting Bundle; 32/64-bit settings
502.5Process failure (out-of-process)Same as 500.30
502.3Bad gateway / timeout from backendLong requests, ARR/ANCM timeout settings
503Service unavailableApp pool stopped (rapid-fail, wrong identity password), queue full