How can I use the new DI to inject an ILogger into an Azure Function using IWebJobsStartup?

前端 未结 5 1794
后悔当初
后悔当初 2021-02-04 03:18

I am using Azure Function v2. Here is my function that uses the constructor injection:

public sealed class FindAccountFunction
{
    private readonl         


        
5条回答
  •  误落风尘
    2021-02-04 03:30

    You can add

      "logging": {
        "fileLoggingMode": "debugOnly",
        "logLevel": {
          "default": "Information"
        }
      }
    

    without the need to add DI if you want to use IloggerFactory

提交回复
热议问题