7

Been toying around with Vercel for deployment and really like the simplicity. Maybe I am not seeing something here, but how can I get visibility into a function without piping to a third-party?

I've got this pages/api/hello.js-api

export default (req, res) => {
    console.log("yolo");
    res.statusCode = 200;
    res.json({ name: "John Doe" });
};

I can then see the following results in the dashboard. But where or how could I see the yolo and I missing something here? Is there a different way for proper debugging?

enter image description here

Fabian Bosler
  • 2,310
  • 2
  • 29
  • 49

2 Answers2

4

While Vercel seems to have fixed the issue with console.log output not showing up in their online dashboard, I still found it pretty frustrating how quickly logs disappeared from their dashboard.

I found using vercel logs --follow <deployment-name> from my terminal to be more useful for debugging issues with my deployed functions.

Rahul Gupta-Iwasaki
  • 1,683
  • 2
  • 21
  • 39
  • For whatever reason, I'm unable to see logs from my Python based serverless functions through the UI. Using the command you provided, however, does work. Thanks for the info. – TheJizel Aug 16 '22 at 22:11
2

Have created the same setup here:

https://github.com/timothyclifford/offsets/blob/master/pages/api/hello.js

Pushed this to Vercel and can see the console logs being printed out correctly:

enter image description here

timothyclifford
  • 6,799
  • 7
  • 57
  • 85