I have two .NET applications hosted on Azure Container Apps. Both applications are set up with the same ApplicationInsights instrumentation key, and I include the service when configuring them.
When I make requests to the applications from an external source, I can see the logs for both apps (Information level and above). However, when I perform a service-to-service invocation using Dapr, I do not receive the logs, even if there are errors.
var methodRequest = this.daprClient.CreateInvokeMethodRequest(HttpMethod.Get,"appid", $"myendpoint");
var response = await this.daprClient.InvokeMethodAsync<ResultBody>(methodRequest, cancellationToken);
This is what I can see in ApplicationInsights:
The invoked endpoint is a minimal API and I'm using the ILoggerFactory
to generate get a logger:
app.MapGet("/myendpoint", async ([FromServices] ILoggerFactory loggerFactory, /*other parameters*/) =>
{
var logger = loggerFactory.CreateLogger("MyEndpoint");
logger.LogInformation("Logging method here");
try
{
How can I show all the logs from the invoked endpoint?