Log Stream of App Service stopped working unexpectedly

Mustafa Jamal 66 Reputation points
2020-05-21T09:34:03.74+00:00

Hi,

I am working on my newly build application. When I uploaded on Azure and enabled to Azure WebApp Diagnostics initially it was showing all logs properly in Log Stream. BUT after publishing code again it stopped working although updated code had noting to do with logging. Please see the configuration below:

In Program.cs:

        public static IWebHostBuilder CreateWebHostBuilder(string[] args)  
        {  
            return WebHost.CreateDefaultBuilder(args)     
                .ConfigureLogging(logging =>  
                {  
  
                    logging.AddAzureWebAppDiagnostics();  
  
                })  
                .ConfigureServices(serviceCollection => serviceCollection  
                    .Configure<AzureFileLoggerOptions>(options =>  
                    {  
                        options.FileName = "azure-diagnostics-";  
                        options.FileSizeLimit = 50 * 1024;  
                        options.RetainedFileCountLimit = 5;  
                    })  
                    .Configure<AzureBlobLoggerOptions>(options =>  
                    {  
                        options.BlobName = "log.txt";  
                    }))  
                .UseStartup<Startup>();  
        }  

In appsettings.json:

 "Logging": {  
    "LogLevel": {  
      "Default": "Debug"  
    }  

In Azure App Service Settings:

8399-21-may-20-2-24-56-pm.png

In AppService Logs:

8390-21-may-20-2-31-05-pm.png

Strange thing is on same setting it was working and stopped working unexpectedly, I am unable to debug issues due to this. Please help.

Thanks,

Mustafa

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

1 answer

Sort by: Most helpful
  1. Miller Meares 16 Reputation points
    2020-07-14T21:57:43.413+00:00

    I experienced this problem! It took me a while to figure it out, but I finally did. I deleted my old log file that was in Home/LogFiles/Application. and then it started working! I'm assuming it was some storage issue.

    Along the way, I also updated the AzureAppServices package manager and uninstalled and reeinstalled the ASP.NET Core Logging Integration extension in Azure. I don't think those contributed, but they could have.

    3 people found this answer 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.