I was wondering if it’s possible to get Function logs for preview deploys, for example for open PRs. As I understand they should be at this URL (not accessible through the UI from what I saw)
But when I navigate there, the page is just loading forever (no errors in network tab from what I’ve seen).
Are we supposed to see preview deploy function logs? If yes, any ideas on how to solve this?
Yes, it is possible to get Function logs for preview deploys. Netlify provides logs to help you observe and troubleshoot serverless functions in your current published deploy, branch deploys, and Deploy Previews.
To access the function logs, you can select a function from the list on your site’s Functions page which will open the log for that function. By default, the Functions list displays the functions in the current published deploy. To find functions on another deploy, you can use the search field at the top of the list. You can start typing to jump to a particular branch, or find a Deploy Preview by number.
Team Owners and Collaborators can monitor the function logs for a specific deploy by going to the Function logs tab of the Netlify Drawer in a collaborative Deploy Preview.
For more details, you can refer to the Function logs section in the Netlify documentation.
When I go to Functions sections for a site, it always shows production functions. I have the search bar, if I click on it I can select between different branches (main / develop etc). For deploy branches I have to enter the deploy number and not a deploy id! (so something like 80 from
Deploy Preview #80). This was my mistake, I was searching after deploy id. Now I can find the logs for specific preview deploys. Thank you so much!
As a side note, you can still access it by URL, it’s just a small change to the one above