I'm using FunctionsStartup
in an Azure Functions project to setup IoC bindings. However, any logs created from an injected ILogger<T>
aren't appearing when I run it in Azure.
I've created a very cutdown version with a brand new example project to demonstrate this...
https://github.com/dracan/AzureFunctionsLoggingIssue
The output of this is...
2020-04-03T20:20:35 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).
2020-04-03T20:20:54.643 [Information] Executing 'TestQueueTriggerFunction' (Reason='New queue message detected on 'myqueue'.', Id=2f13c4c7-8a35-4614-a768-1c3fecea8c31)
2020-04-03T20:20:54.654 [Information] Start of function (this log works)
2020-04-03T20:20:54.655 [Information] End of function (this log also works)
2020-04-03T20:20:54.655 [Information] Executed 'TestQueueTriggerFunction' (Succeeded, Id=2f13c4c7-8a35-4614-a768-1c3fecea8c31)
Note that the log entry "This log doesn't appear!" in MyClass.DoSomething()
doesn't appear.