Hi @Kanav Sharma ,
Thanks for posting your question in Microsoft Q&A, apologize for any inconvenience caused on this.
To send logs from your xyz.log file inside a Docker container to Azure Application Insights, you can follow these steps:
In the Azure portal, click on "Create a resource" and search for "Application Insights" and click "Create" and fill in the required details such as the resource name, subscription, resource group, and region then click "Review + create" and then "Create", Also ensure your Docker container is set up to send logs to Application Insights and You can use the opencensus-ext-azure package for Python applications, as mentioned earlier.
- In the Azure portal, search for "Log Analytics workspaces" and create a new workspace and link your Application Insights resource to this workspace by navigating to your Application Insights resource, selecting "Properties", and then selecting the Log Analytics workspace you created then navigate to your Docker container's resource in the Azure portal under "Monitoring", select Diagnostic settings and click on "Add diagnostic setting" and choose the logs you want to send to Application Insights then select your Application Insights resource as the destination.
- At last, navigate to your Application Insights resource and select "Logs" from the left-hand menu to query and view your logs, for your reference use the following query to view your logs:
traces
| where message contains "your log message"
Also, you are trying to fetch live metrics from docker container/azure container app to App Insights so for these please refer the below documents:
https://learn.microsoft.com/en-us/azure/container-apps/metrics
I hope the above provided information might help you, if you have any further queries, please feel free to reach out to us.