How to see log stream of webserver and application logs on Azure WebApp
This might be the first question that comes in the mind for most of us when we have to debug some issue related to our app on Azure WebApp.
Well look no further, Azure has already provided this functionality generally available with all the WebApps in all the regions. In the Azure Webapp’s settings menu, go to Monitoring and there you’ll find App Service logs and Log Stream.
However before you can view the logs in Log Stream, you need to enable to the application and webserver logs from App Service Logs.
Here are the steps to enable and view the logs from Log Stream:
- Navigate to the App Service Logs under Monitoring in WebApp’s left menu.
- Enable the Application Logging
- Set the Logging level as per requirement (Error, Warning, Information & Verbose)
- Enable the Web Server Logging
- Set the Quota for log file in MB (Maximum size 100 MB)
- Set the Retention Period for your logs. The logs will get deleted once they expire the retention period set by you here.
- Enable the Detailed error messages
- Enable Failed Request tracing.
- Click on Save.
Now you’re all set for viewing the Application and WebServer logs Log Stream!
- Navigate and click on the Log Stream option under Monitoring in Azure WebApp’s left menu.
- You should see Application Logs radio button selected by default in the Log Stream blade.
- In the blank screen, first you should see the log stream initialization and then application logs should start flowing eventually on the screen.
- Click on the Web Server logs radio button in the Log Stream blade to view the Web Server log stream.
- Similarly as it happened with Application logs log stream, the Web Server logs log stream should get initialized and web server logs should start coming up eventually.
You may also download the logs via ftp using the deployment credentials set for Azure WebApp and by ftp access link using any of the ftp clients.