Enable diagnostic logging Flashcards
Application logging
Win/Lin:
App Service file system and/or Azure Storage blobs
Logs messages generated by your application code. The messages are generated by the web framework you choose, or from your application code directly using the standard logging pattern of your language. Each message is assigned one of the following categories: Critical, Error, Warning, Info, Debug, and Trace.
Web server logging
Win:
App Service file system or Azure Storage blobs
Raw HTTP request data in the W3C extended log file format. Each log message includes data like the HTTP method, resource URI, client IP, client port, user agent, response code, and so on.
Detailed error logging
Win:
App Service file system
Copies of the .html error pages that would have been sent to the client browser. For security reasons, detailed error pages shouldn’t be sent to clients in production, but App Service can save the error page each time an application error occurs that has HTTP code 400 or greater.
Failed request tracing
Win:
App Service file system
Detailed tracing information on failed requests, including a trace of the IIS components used to process the request and the time taken in each component. One folder is generated for each failed request, which contains the XML log file, and the XSL stylesheet to view the log file with.
Deployment logging
Win/Lin:
App Service file system
Helps determine why a deployment failed. Deployment logging happens automatically and there are no configurable settings for deployment logging.
Stream logs
Azure portal - To stream logs in the Azure portal, navigate to your app and select Log stream.
Azure CLI - To stream logs live in Cloud Shell, use the following command:
Bash
az webapp log tail –name appname –resource-group myResourceGroup
Local console - To stream logs in the local console, install Azure CLI and sign in to your account. Once signed in, follow the instructions shown for Azure CLI.