Log Stream of App Service stopped working

Alexander Großauer 101 Reputation points
2019-12-13T06:49:51.63+00:00

I used the Log Stream feature quite often and it worked very well. But some time ago it stopped working at all.

I turn on "Application Logging (File System)" and set the Level to "Information" as always, but I don't see any of my log messages in the stream.

It is an ASP.net Core App.

No new logfile is created in D:\home\LogFiles\Application

It seems like the content of D:\home\LogFiles\SiteExtensions\DaaS\some-guid.txt is written to the log stream instead...??

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,826 questions
{count} votes

Accepted answer
  1. Alexander Großauer 101 Reputation points
    2020-01-22T13:13:50.833+00:00

    I fixed the problem by adding the AzureWebAppDiagnostics Logging provider.
    A few months ago this was not needed, so it seems the defaults have been changed at some time.

    public static IHostBuilder CreateHostBuilder(string[] args) =>  
        Host.CreateDefaultBuilder(args)  
            .ConfigureLogging(logging =>  
            {  
                logging.AddAzureWebAppDiagnostics();     
            })  
            .ConfigureWebHostDefaults(webBuilder =>  
            {  
                webBuilder.UseStartup();  
            });  
    

    See https://learn.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-3.1

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 18,196 Reputation points
    2020-01-10T11:08:25.17+00:00

    @Alexander Großauer Thanks for the reply! To add to this the Filesystem option is for temporary debugging purposes and turns itself off in 12 hours. So, could you try changing it to blob option which is for long-term logging and require blob storage container. Let me know how it goes.

    Reference: https://learn.microsoft.com/en-us/azure/app-service/troubleshoot-diagnostic-logs#enable-application-logging-windows