Hi @Siegfried Heintze ,
Thank you for showing interest in Application Insights for your application. Please find below the response to your queries. (In your question, by Log Analytics
- you are referring to Log Analytics workspace
. Log Analytics
is a tool in the Azure portal to edit and run log queries against this workspace)
1. Log Analytics workspace is the storage environment for storing log and other monitoring data collected from various sources - ApplicationInsights, Microsoft Sentinel, Microsoft Defender for Cloud etc. Therefore, you can think of it has the backend storage where all the information collected by ApplicationInsights is stored.
Whenever you run a Kusto query - either in Azure Monitor, Log Analytics Workspace or from Application Insights, they all run on the Logs stored in "Log Analytics Workspace" as available from the scope (shown below).
2. Logging providers store logs, except for the Console
provider which displays logs. Therefore, System.Console.WriteLine
could be useful when you are working with console application with attached console which will output the log messages. However, for WebApplication Razor and Blazor pages, this will not be ideal - as most of the time the console will not be available to view output.
System.Diagnostices.Trace
- generally writes the logs to log file of the application. There are 2 ways that the traces from this module can be send to "Log Analytics Worksapce"
- Send to
LogAnalytics workspace
using Diagnostic Settings available in App Service in Azure portal - If you enable "Application Insights" on the App Service directly, it can listen to these traces without any additional configuration. Please see this link for details - Explore .NET/.NET Core and Python trace logs in Application Insights
I would recommend using the Ilogger method as it more convenient and can be easily used with dependency injection to meet the requirement.
3. They all query the same datasource and present the same result. Please see answer 1 for more details. These are some of the different methods for querying same underlying data.
4. No, you would not be able to use Kusto directly on Blob storage. Blob storage stores details in blobs (similar to files on disk). You may use Azure Storage Explorer to view the contents of blobs in the storage account. There are other ways to query/analyze blob content (using Synapse, Data Explorer etc), however the basic use case of storing logs in Blob is to retain it for longer duration.
The data contained in Log Analytics workspace (collected through Application Insights) is much easier to run queries and get results.
Please let me know if you have any questions.
---
Please 'Accept as answer' if it helped so that it can help others in the community looking for help on similar topics.