Functions logs not loading

Hello, we are having trouble accessing the functions logs in the Netlify UI. All we see is the “slash” thing spinning but no actual output. The function has been invoked today by a webhook and returned 200 so we are sure something must have been logged. We have this problem also on the staging version of the site, from which we’ve read the logs correctly in the past days, but not anymore.

Hi Matteo,

Function logs last only 1 hour after invocation. I suspect your last invocation was more than an hour ago. If you execute the function anew, do you see logs? If not, please let us know the value of the x-nf-request-id http response header, which you can get as described in this article:

I’m having the same problem (no logs for functions, just has the spinning slash, and it has been less than an hour). I’m not sure which request I should be looking at for the x-nf-request-id, so I just took it from the request for the page.

x-nf-request-id: 7c99a059-061e-4fa9-a7b2-9770a8a54b19-101635051

I’m trying to get a deploy-building function to work.

If it helps, the site I’m working on has two functions right now: deploy-building.js and submission-created.js. The logs for submission-created do work but deploy-building does not. My expectation is that when I initiate a deployment, or an automatic deployment is triggered, deploy-building should run, but I’m not sure if this is happening.

Edit: It turned out that my asynchronous things weren’t getting a chance to run before the function “completed.” I successfully got the function to wait for the asynchronous things to finish before returning a 200, and now I have logs and new problems. :slight_smile:

I’m surprised that you see logs for submission-created.js - as far as I know we don’t currently intend to display logs for any event-triggered function (these in particular: Form submissions might be special since the form submission is in essence “sent” to the function, but that is unfortunately working as designed. I have an open feature request to show those logs and have attached this thread to it, so we can report back if the situation changes.

I’ve also marked this thread for discussion with the documentation team to see if we can make it clearer that this is the case, since it has been the case for well over a year now.

Very sorry that you spent time debugging it!