Hey all, I’ve found I can’t see/access functions and their logs when deploying a preview with Netlify CLI.
I deploy with netlify deploy, then go to the Netlify dashboard.
I can’t see the functions & logs from my production site, but there are no functions/logs for my Deploy Preview, which is labeled as “Deploy Preview #null”
Is there another way to review logging on functions deployed via netlify cli?
Hi @question_asker, what was the exact command you used to deploy that got you a #null? Also, have you tried using --alias and see if that works to let you access your function logs. Hope that helps.
Could you tell us the deploy ID (last characters in the path - hex string) for a deploy that you assert has functions, but no logs? We’ll want to examine in our database.
Hi @question_asker and @Sensibleish,
I’ve done some digging in several of your deploy logs, our database logs, and our internal issue trackers.
Unfortunately, it does seem impossible at this time to view function logs of manual deploys. You are also running into another issue which is that we currently only show function information and logs for functions on the current HEAD branch. There are ongoing discussions and several open issues about this internally, but the only thing I can recommend for you to have more visibility into your functions today is to deploy from a repo.
@Sensibleish, it seems like you did switch back from deploying manually to deploying from a repo- were you able to see function logs when you did that?
Deploying via repo has always worked as expected for this project.
My intent with netlify deploy is the basic cycle of testing my code modifications before committing. It’s just more convenient and doesn’t create a messy git history.
This does require that functions each have their own package.json, so may have to tweak your file structure from what it would be if you are deploying to Netlify.
Alternatively, you could manually deploy functions and send logging messages in the response body, but that is admittedly not a great pattern. And also probably not the way you want to spend your build minutes.
Let us know if we can help with the local functions testing.