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?