Logging

+
~

There are a selection of different diagnostics to assist with debugging an App Service app. The following table shows types, support, storage location and a description:

Type Platform Location Description
Application logging Windows, Linux File system
Blob storage
Logs generated by your application (Critical, Error, Warning, Information, Debug, Trace).
Deployment logging Windows, Linux File system Deployment logs for debugging failed deployments.
Web server logging Windows File system
Blob storage
Raw HTTP request data.
Detailed error messages Windows File system Copies of the HTML debug pages that are displayed outside of production.
Failed request tracing Windows File system Trace of failed requests, IIS components used, duration in each component, each failed request generates a separate XML/XSL report.

Configuration

Instructions for enabling optional logging.

Application

Web server

Only available on Windows
  1. App Service logs
  2. Web server logging
    • Storage for blob storage (set storage container and Retention Period (Days))
    • File System for file system (set Quota (MB) and Retention Period (Days))
  3. Save

Streaming

Usage

You can log to application logs using System.Diagnostics.Trace:

System.Diagnostics.Trace.TraceError("If you're seeing this, something bad happened");

Access

You can access your stored logs in different ways depending on the storage method:

Linux/container logs

The zip file at the address above contains both docker host and container logs. For scaled-out apps, the ZIP container logs for each instance individually.