I would like to consume log stream data programatically and perform some action.
Are there any APIs for achieving this ?
I would like to consume log stream data programatically and perform some action.
Are there any APIs for achieving this ?
As far as I know, azure Diagnostic information stored to the web app file system can be accessed directly using FTP.
It can also be downloaded as a Zip archive using Azure PowerShell or the Azure Command-Line Interface.
The path is as below:
The log stream also read the log from the LogFiles folder(D:\home\LogFiles\ ).
So if you want to get the logs programatically, you need firstly download the logs by ftp or command-line.
Besides, if you want to steam logs in local, I suggest you could consider using C# run powershell script.Because, azure powershell SDK has command to stream logging information.About how to call powershell script, you could refer to this question.
Get-AzureWebSiteLog -Name webappname -Tail
To get a list of your web apps run the following command:
Get-AzureWebsite
If you're using 'Slot deployment' you must use the fully qualified name (in quotes):
Get-AzureWebSiteLog -Name "webappname(Staging)" -Tail
More details about how to download or stream logs, you could refer to this article.