0

I've got a function deployed to Azure using Dotnet Core 6.0. I'm trying to troubleshoot it and it doesn't seem like my ILogger logs are getting through to it. Those would be immensely useful.

Trigger details and Execution logs are appearing, but not my custom logging. My Startup class is basically empty. Is there something additional that I need to add to my function to get my ILogger logs into AI?

The function, abbreviated.

public class QueueWorker
{
    private readonly ILogger<QueueWorker> _logger;
    

    public QueueWorker(ILogger<QueueWorker> logger)
    {
        _logger = logger;
    }


    [FunctionName("QueueWorker")]
    public async Task Run([ServiceBusTrigger("incoming", Connection = "EventBusConnection")] string serialMailEvent)
    {

          _logger.LogInformation("Processing Event");
    }

}

host.json

{
  "version": "2.0",
  "logging": {
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": false,
        "excludedTypes": "Request"
      }
    },
    "fileLoggingMode": "always",
    "logLevel": {
      "default": "Trace",
      "Host": "Trace",
      "Function": "Trace",
      "Host.Aggregator": "Trace"
    }
  }
}
Darthg8r
  • 12,377
  • 15
  • 63
  • 100
  • are you using dotnet or dotnet-isolated ? – Thomas Jun 14 '22 at 21:06
  • have you turned on App Insights? And can you see the related configuration (instrumentation key & app insights connection string) in Azure Function's Application Settings? Can you have a look at this - https://stackoverflow.com/a/72628461/9276081 – Bandook Jun 15 '22 at 09:01

0 Answers0