1
votes

I have read several docs and tutorials about Azure App Services.

What i want to do is to see my application log (errors, exceptions, etc.) in azure portal.

I have read i need to configure something in order to store my logs to a Storage account, Log analytics, or Event Hub.

But, this command line shows me the logs !

az webapp log tail --name myapp --resource-group mygroup

So there is no need to configure anything in order to collect log, if this command can do it...

How can i do the same thing in azure portal ?

And how can i see more than 10 lines with this tail ?

Thanks

3

3 Answers

1
votes

I find using "Log Stream" very useful. It outputs all your logs in realtime to the portal.

enter image description here

1
votes

You can enable logging on the app service by browsing to the app service logs section under the app service blade in the azure portal. Here is a link that shows how to do it: https://manojchoudhari.wordpress.com/2019/11/01/azure-app-service-and-diagnostics-logging/

Here is another article that shows how to enable diagnostic logging on the app service from the portal: https://docs.microsoft.com/en-us/azure/app-service/troubleshoot-diagnostic-logs

In terms of the tailing command, the documentation doesn't have any params to do this so I doubt it you can increase the number of lines. However, you can output your logs with -o which you might already know.

0
votes

When your web apps service is down you can get more details in "Diagnose and solve problems" in azure portal, you can get application logs, container issue, memory usage and other details. https://docs.microsoft.com/en-us/azure/app-service/overview-diagnostics

If you want to debug your code deployed in app service inside azure portal then you can go to advanced tool and launch KUDU. https://www.gslab.com/blogs/kudu-azure-web-app

Note: You need to have contributor permissions for this.