Where are NextJS API logs? Specifically for Deploy Previews?

Where are these logs?

When I go to functions, I see only this

When I go to Edge functions, I see nothing

We have 2 api routes on our production deploy that are in use, and I have a 3rd I am trying to test on a deploy preview. How do I view any of these?

Hey @paul.mourer do you happen to have an adblock? I faced this same issue a couple weeks back. Seemed that adblock didn’t like the edge terminal view for some reason

Good thought - I actually did have an adblock extension that I totally forgot about. However, I disabled it for app.netlify.com and still have the same view. I confirmed in my network tab that there were no failed requests as well.

@paul.mourer what site is this for?

messaged you the URL

The API logs are available in the ___hetlify-handler function, by the way. Not sure why you were checking Edge Functions logs.

I was looking there because the __netlify-handler logs were empty.

I just tried again, and I am able to see production logs there - it’s a bit confusing because the real time logs don’t actually work as I expected. They only seem to show logs since I visited the page, which I found confusing, I expected that “real time” just meant they would update in real time. Not that they would only show logs since I landed on the page.

Regardless, deploy preview logs are still not there. Where are those located?

The only information I could find on the subject was here:

which references “serverless functions” which is no longer a tab in admin. I could find no mention in the docs as to where to expect these logs to exist. I don’t find the naming particularly clear, why would I expect the logs to be under “__netlify-handler”? I see now during deploy that functions are deployed:

8:05:01 AM: Packaging Functions from .netlify/functions-internal directory:
8:05:01 AM:  - ___netlify-handler/___netlify-handler.js
8:05:01 AM:  - ___netlify-odb-handler/___netlify-odb-handler.js
8:05:01 AM:  - _ipx/_ipx.js

but it is very unclear what any of these do or what do expect in each log.

Hi @paul.mourer ,

If you open the real time logs and invoke your function you should see the log entries in real time. Let us know if that’s not the case! :slight_smile:

You can see functions logs for deploy previews two ways:

  1. Click on the Functions link from the deploy log

  2. OR search by the deploy preview number on the Functions tab:

About the serverless functions… those are generated by Netlify’s Next.js Runtime in order to enable key Next.js functionality. It automatically generates serverless functions that handle server-side rendered (SSR) pages, incremental static regeneration (ISR), images, and Next.js features.

Let me know if that helps!