question

ScottM-7356 avatar image
0 Votes"
ScottM-7356 asked azure-cxp-api edited

Azure app service log integration with log analytics?

Looking to connect two log data sources from my azure app service with azure log analytics.

  1. event log type data (i.e logger.log(exception)

  2. w3c log type data

Are there any docs for connecting these logs to log analytics?

azure-webapps
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

SnehaAgrawal-MSFT avatar image
1 Vote"
SnehaAgrawal-MSFT answered

Thanks for asking question! With the new Azure Monitor integration, you can create Diagnostic Settings (preview) to send logs to Storage Accounts, Event Hubs and Log Analytics.


To create a Diagnostic setting Go to Azure portal > Select App Service > under Monitoring, select Diagnostic settings > Add diagnostic setting> Diagnostic-Settings-Page will open > create the Diagnostic setting by providing a name for the Diagnostic setting> Select your desired destination(s) for the logs> Log Analytics Workspace: Analyze the logs with other monitoring data and leverage Azure Monitor features such as log queries and log alerts> Select the desired log categories to export > Select Save at the top this will trigger App Service to begin sending your logs to the chosen destinations.

There are six log categories in addition to your metrics. The table below lists the log types with its description and availability per OS.
You may use AppServiceHTTPLogs which Access logs from the web server logs.

8869-2020-06-02-00-27-54-enable-diagnostics-logging-azu.png



You may refer to below doc links for more details:

https://docs.microsoft.com/en-gb/azure/azure-monitor/platform/diagnostic-settings

https://docs.microsoft.com/en-us/Azure/app-service/troubleshoot-diagnostic-logs#send-logs-to-azure-monitor-preview



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.