2

I have a Durable Function that I'm trying to view streaming logs for in the Azure Portal, but for some reason I can only seem to view logs perhaps one in every 10 or 20 times I try connecting to the log streaming service. When it doesn't work, it looks as if it connects but nothing is shown on screen besides the basic:

Connecting...
2019-09-10T05:51:31  Welcome, you are now connected to log-streaming service. The default timeout is 2 hours. Change the timeout with the App Setting SCM_LOGSTREAM_TIMEOUT (in seconds).
2019-09-10T05:52:32  No new trace in the past 1 min(s).
2019-09-10T05:53:32  No new trace in the past 2 min(s).
(... etc)

I know the function is working because it will process items from the queue just fine, and I can keep trying to reconnect to the service and eventually it reconnects "properly" and I see the logs. I'm not sure if it's just me, but it seems to have more luck connecting just after the function app has been restarted.

Some background:

  • My durable function app (using Functions 2.0) has about 20 functions including the orchestrators, sub-orchestrations and activity functions. Hmmm... 20 functions, and a 1-in-20 chance of connecting - coincidence? Perhaps each function has its own log stream, and connecting to the function app stream will randomly pick a function until I get the right one? But the thing is that most of my functions log stuff, and I only ever see all logs or (most of the time) nothing.
  • The logs are just using standard Functions logging, nothing special. The only other thing I'm using regarding logging is Services.AddApplicationInsightsTelemetry().

What could be causing the log stream to only connect sometimes?

pcdev
  • 2,852
  • 2
  • 23
  • 39
  • Suppose this is the streaming timeout,doesn't always show the logs. you could go to the kudu site check the log file.Go to https://[your-function-app].scm.azurewebsites.net/, Debug console > CMD,go into `D:\home\LogFiles\Application\Functions\Host\` or `D:\home\LogFiles\Application\Functions\Function\function-name\`. – George Chen Sep 10 '19 at 11:31

1 Answers1

1

You may refer to this tutorial:https://learn.microsoft.com/en-us/azure/azure-functions/functions-dotnet-dependency-injection#logging-services

enter image description here

Hury Shen
  • 14,948
  • 1
  • 9
  • 18
  • Thanks, I think you are suggesting to remove AddApplicationInsightsTelemetry - I wish that was it, I've tried removing it and redeploying and it hasn't fixed the problem. But thanks for the heads up on that - I had seen it before but forgot about it. – pcdev Sep 10 '19 at 10:03
  • Hey, any update on this ? Encountering similar issue. Just checking the kudu is not sufficient for me. – DataBach Mar 03 '22 at 08:42
  • Same issue here with a TypeScript function. Even the hosted version seems to be buggy (one year later) – frbl Mar 15 '23 at 14:02