Web Server Logs on Azure

Alberto De Natale
3 min readJun 2, 2019

--

There are two major types of logs that can be collected from a running .NET Core web application running on an Azure App Service: Web Server Logs and Application Logs. Web Server Logs are generated from the server and they are split into Detailed Error Logging, Failed Request Tracing, Web Server Logging.

Detailed Error Logging

These are the typical HTML pages that are shown to the user by the server when an error occurs having a code of 400 or higher. For instance:

They are activated through the following setting:

Would generate the following log in the folder

“D:\home\LogFiles\DetailedErrors”

Up to 50 errors are retained. Past this threshold, the oldest 26 are automatically deleted.

Failed Request Tracing

Request traces are very useful to identify bottlenecks when one of the modules involved in processing a request is taking a long time or some error occurs at some stage.

In order to enable them, from the Azure portal turn on the setting:

Log traces are stored under the folder:

” D:\home\LogFiles\W3SVC1001602005”

They produce the following result:

An extract of the log is:

And the matching error page:

Web Server Logs

Web Server Logs are stored under folder:

“D:\home\LogFiles\http\RawLogs”

They can be enabled by running with the following setting:

They follow the W3C format and can be read using an application called “LogParser”.

After downloading the application and the log I managed to run some simple query on the file that returned me the count of the entries found inside the log.

Conclusions

Azure app services expose many server-level logs that are very easy to access and may save time when troubleshooting slow or broken applications.

--

--

Alberto De Natale

Alberto De Natale is a passionate tech-enthusiast software developer.