Azure function apps logs not showing

后端 未结 6 785
刺人心
刺人心 2020-12-29 02:49

I\'m relatively new to Azure and I just went through the tutorial on how to create a new Azure function, which is triggered when a new blob is created, and had this as the d

相关标签:
6条回答
  • 2020-12-29 03:09

    The log window is a bit fragile and doesn't always show the logs. However, logs are also written to the log files.

    You can access these logs from the Kudu console: https://[your-function-app].scm.azurewebsites.net/

    From the menu, select Debug console > CMD

    On the list of files, go into LogFiles > Application > Functions > Function > [Name of your function]

    There you will see a list of log files.

    0 讨论(0)
  • 2020-12-29 03:12

    Indeed, the Logs section of the Function App in the Azure portal seems fragile. I had it open a few ours unused and then it did not log anything anymore. Closing the Function App and reopening it solved the problem.

    0 讨论(0)
  • 2020-12-29 03:16

    I would entirely avoid waiting for the logs to appear in the function app. Go over to Monitor on the left and go through it that way. Even then though there can be a solid 5 minute delay on them coming through. How on earth can aws be the only provider in this space that's able to give you logs immediately? GCP is bad for it as well.. (not sure about alicloud)

    0 讨论(0)
  • 2020-12-29 03:24

    Following the advice here worked for me. Configuring Log Level for Azure Functions

    If you want to see your logs show up immediately in the Portal console after you press "Run", then go to your "Function app settings" and add the following to your host.json file:

    "logging": {
        "fileLoggingMode": "always",
        "logLevel": {
            "default": "Information",
            "Host.Results": "Error",
            "Function": "Trace",
            "Host.Aggregator": "Trace"
        }
    }
    

    Note that this only worked for Javascript functions. For locally developed functions in other languages, the console can be a bit skittish.

    0 讨论(0)
  • 2020-12-29 03:26

    Azure Portal was updated last week and they moved logs from Monitor to the home of the actual Azure Function. However, to see them you need to click Test. I raised an issue with Microsoft support and they spent several days twiddling their thumbs before I came across the answer myself. I hope this saves others a bit of time

    0 讨论(0)
  • 2020-12-29 03:34

    Log messages should show under the function code, if you're watching that window at the time of the function's execution:

    To view log messages made while you weren't looking, you'll need Application Insights configured. If that's configured, that should show under the Monitor tab:

    0 讨论(0)
提交回复
热议问题