Skip to content

Commit 010e86c

Browse files
feat: add request logging (#1127)
* feat: add request logging * chore: add doc Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent 4c92d07 commit 010e86c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ you can remove it. Alternatively you can
8585
support. See [`demos/next-export`](https://github.com/netlify/netlify-plugin-nextjs/tree/main/demos/next-export) for an
8686
example.
8787

88+
## Generated functions
89+
90+
This plugin works by generating three Netlify functions that handle requests that haven't been pre-rendered. These are
91+
`___netlify-handler` (for SSR and API routes), `___netlify-odb-handler` (for ISR and fallback routes), and `_ipx` (for
92+
images). You can see the requests for these in [the function logs](https://docs.netlify.com/functions/logs/). For ISR
93+
and fallback routes you will not see any requests that are served from the edge cache, just actual rendering requests.
94+
These are all internal functions, so you won't find them in your site's own functions directory.
95+
8896
## Feedback
8997

9098
If you think you have found a bug in the plugin,

src/templates/getHandler.ts

+1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ const makeHandler =
9999
multiValueHeaders['cache-control'] = ['public, max-age=0, must-revalidate']
100100
}
101101
multiValueHeaders['x-render-mode'] = [requestMode]
102+
console.log(`[${event.httpMethod}] ${event.path} (${requestMode?.toUpperCase()})`)
102103
return {
103104
...result,
104105
multiValueHeaders,

0 commit comments

Comments
 (0)