question

AlexanderGrossauer avatar image
0 Votes"
AlexanderGrossauer asked ·

Log Stream of App Service stopped working

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-webapps
· 4
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for asking question! Could you Please take a look on your Azure App Service settings, WEBSITE_LOCAL_CACHE_OPTION. This might be a reason why Log Stream of App Service stopped working. You may also try to scale up to medium size worker and then again scale down to the small size worker. Let me know how it goes.

0 Votes 0 · ·

Thanks for your reply. Local cache is currently not activated, we plan to activate it in the future though. But as far as I know the local cache should just delay the log stream and not deactivate it, right? I guess scaling up and down will trigger a restart of the app service. We want to avoid restarts during the week whenever possible. I will try it on the weekend and keep you posted.

0 Votes 0 · ·

Try setting the log level to verbose to capture everything being outputted.

0 Votes 0 · ·
Show more comments
AlexanderGrossauer avatar image
1 Vote"
AlexanderGrossauer answered ·

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://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-3.1

· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

SnehaAgrawal-MSFT avatar image
0 Votes"
SnehaAgrawal-MSFT answered ·

@AlexanderGrossauer 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://docs.microsoft.com/en-us/azure/app-service/troubleshoot-diagnostic-logs#enable-application-logging-windows

· 1 · Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you, but a logging for temporary debugging purposes is exactly what I need. I don't want to store any logs long-term.

0 Votes 0 · ·