In my previous articles listed below, we have learned how to create Azure App Service web app.
- Azure App Service: Create Web App from Visual Studio
- Azure App Service - Configure Existing Application From Visual Studio
Prerequisites
- Azure Account
- FileZilla
Azure allows us to enable the Web Server diagnostic services for debugging and troubleshooting for all the App Services. Below are the different types of services that Azure App Service provides us.
- Detailed Error Logs – These error logs provide information about all the HTTP errors generated.
- Failed Request Tracing – These logs help us understand the reasons for all the failed requests.
- Web Server Logging – These logs provide information about all the events that occur on the server, like number of requests, and IP Address of the user who made the requests etc.
Let’s see how to enable Detailed Error Logs for Azure App Service. Before you enable the Error logs, please have a look at the folder structure of the App Service Web App that I have created.
Root Folder
Log Files Folder
- Log Files – This folder contains most of the Log information that server generates.
- Site – This folder mostly contains Codebase of our Web App.
Login to the Azure Management portal and navigate to the settings of the App Service Web App for which you would like to enable the Detailed Error logs, as shown below.
Now, click on “Diagnostic Logs”, as shown below.
You will be taken to the “Logs” blade, as shown in the below screen capture.
By default, the “Detailed error messages” are turned off. Click on the “On” toggle button of the “Detailed error messages”, as shown below, and click on “Save” button.
You have now turned on the “Detailed Error messages”. Let’s now access the App Service – Web App.
Now, go back to the FileZilla and refresh the folder contents, as shown below.
You will see a new folder named “Detailed Errors”, as shown below.
Navigate to the “Detailed Errors” folder to view the errors that have been generated by the App Service.
I have downloaded the “ErrorPage000001.htm” into my local machine and here is the screen capture of the same when page is opened in browser.
The error was because of a missing file named “Favicon.ico”, for this App Service, though this is a basic example of error logging. In real time, by looking at these error logs, you can take upfront actions way before your client or the user complains about these HTTP errors.
Hope you enjoyed the article, your feedback is highly appreciated.