Skip to content

feat: add request logging #1127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ you can remove it. Alternatively you can
support. See [`demos/next-export`](https://github.com/netlify/netlify-plugin-nextjs/tree/main/demos/next-export) for an
example.

## Generated functions

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

## Feedback

If you think you have found a bug in the plugin,
Expand Down
1 change: 1 addition & 0 deletions src/templates/getHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ const makeHandler =
multiValueHeaders['cache-control'] = ['public, max-age=0, must-revalidate']
}
multiValueHeaders['x-render-mode'] = [requestMode]
console.log(`[${event.httpMethod}] ${event.path} (${requestMode?.toUpperCase()})`)
return {
...result,
multiValueHeaders,
Expand Down