Configure http logging for an Azure Web app service

Tags: http logs, azure

As I was currently working on the FinalAnalytics web site hosted on Azure and that the first tool that FinalAnalytics will release is the HttpLogBrowser, I took a look on how to retrieve http logs from an Azure Web service.

In the Azure portal, select the concerned Web App service then in the App Service go in Diagnostic logs and for the setting Web server logging select File System.

Enable http logging in an Azure web app

Once this is done the http logs will be stored on the file system of your web application and you can retrieve them with an ftp client. The ftp address is mentioned in the Download logs section but first you need to make sure that the ftp account has been set.

If no FTP has been defined yet, select Deployment Credentials in the concerned App service and provide an account name and a password for the ftp access.

Configure FTP credentials in an Azure web app

Once this is done, you can configure your ftp client to access the ftp site of the Web application. In my example I will use the FileZilla ftp client. In FileZilla, go in the Site manager and create a new site, enter the address of the ftp site as mentioned in the Download logs section of the Diagnostic logs settings, select Requires explicit ftp over TLS as encryption, set the user name like indicated in the Download logs section and specify the password for the account.

Add FTP site for an Azure web app in FileZilla

Once the ftp site has been created, you can open the ftp connection. After the connection has been established, you will see several folders in the remote tree. For example, the folder /Site/wwwroot contains the files of your web site. If you are interested in the log files you will find them in the folder /LogFiles and more specifically the http logs are located in the folder /LogFiles/http/RawLogs. You are then able to easily download them.

Browse to the Azure Http logs in FileZilla

It’s also possible to select Storage instead of File System to store the http logs but doing so you will not be able to download them with an ftp client. You will need to use a PowerShell command after installing the Azure PowerShell module on your local machine.

If you are interested there are also other kinds of logs you can enable. You will find more information on Diagnostic logs for Azure web services in the following web page:

https://docs.microsoft.com/en-us/azure/app-service-web/web-sites-enable-diagnostic-log

1 Comment

  • Simon said

    Thanks for the tip. Worked perfectly.

You must log on to comment.