Why am I not getting Trace logging on Azure App Server

David Thielen 3,211 Reputation points
2024-02-22T03:19:14.1933333+00:00

Hi all; I am using the same log settings on my dev system and on Azure. Both use appsettings.json. I have no Logger settings in appsettings.Development.json or secrets.json on my dev system. I have none in the Environment Variables on Azure. My logs on my dev system show LogTrace() (where specified). But on Azure it does not. It has DEBUG, but not TRACE. Is there some override I need to set in Azure to allow Trace logging? This is not for the app service logs in Azure, it is for an ILoggerProvider I have written myself. thanks - dave

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,658 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,960 questions
{count} votes

Accepted answer
  1. Ryan Hill 30,281 Reputation points Microsoft Employee Moderator
    2024-02-28T16:09:39.85+00:00

    Hi @David Thielen
    Glad to hear you were able to resolve your issue. I know you mentioned having something set somewhere in the log levels that you couldn't find. I've personally been down that road before.On App Service, you can elect what types of logs to show, see https://learn.microsoft.com/en-us/azure/app-service/troubleshoot-diagnostic-logs. When you use appsettings.json, those settings supersede what's in configured in the portal but since you didn't have any such configuration files, App Service would've defaulted to App Service Logs settings. When it comes to logs not appearing as expected, the first place to check would be these settings.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.