0
votes

We have developed a PHP application and hosted the same in Azure Webapp with Linux as the operating system.

Currently the log files are getting generated inside the wwwroot/storage/logs as shown in attached ssh console app screenshot.

We have enabled the Custom logs for the App Service from Log Analytics as shown in log analytics screenshot. (I was unable to understand whether path should be given from home or site so I added both).

When I tried to query the custom log in the Azure Log it is returning empty data. Please find the attached screenshot for reference log image

Please help me in understanding what is the mistake.

Thank you.

1

1 Answers

1
votes

Your app needs to be running in a VM to use Custom Log Analytics in that manner. Just ensure you've properly installed and configured the OMS agent according the steps documented in https://docs.microsoft.com/en-us/azure/azure-monitor/platform/data-sources-custom-logs.

Since you're using an App Service, there isn't Custom Log Analytics available. There is, however, Log Analytics integration for App Services which is currently in preview and supports the following types:

  • AppServiceHTTPLogs
  • AppServiceConsoleLogs
  • AppServiceAppLogs
  • AppServiceFileAuditLogs
  • AppServiceAuditLogs

You can also leverage this SDK to write your custom log messages to application insights.