How-to
Integrate flags with Runtime Logs
Integrate your feature flag provider with runtime logs.Table of Contents
Next.js (/app)
On your dashboard, the Logs tab displays your runtime logs. It can also display any feature flags your application evaluated while handling requests.
![Feature Flags section in runtime logs](/_next/image?url=https%3A%2F%2Fassets.vercel.com%2Fimage%2Fupload%2Fv1717695155%2Fdocs-assets%2Fstatic%2Fdocs%2Fworkflow-collaboration%2Ffeature-flags%2Flogs-light.png&w=1080&q=75)
![Feature Flags section in runtime logs](/_next/image?url=https%3A%2F%2Fassets.vercel.com%2Fimage%2Fupload%2Fv1717695155%2Fdocs-assets%2Fstatic%2Fdocs%2Fworkflow-collaboration%2Ffeature-flags%2Flogs-dark.png&w=1080&q=75)
To make the runtime logs aware of your feature flag call reportValue(name, value)
with the flag name and value to be reported. Each call to reportValue
will show up as a distinct entry, even when the same key is used:
app/api/test/route.ts
import { reportValue } from '@vercel/flags';
export async function GET() {
reportValue('summer-sale', false);
return Response.json({ ok: true });
}
If you are using an implementation of the Feature Flags
pattern you
don't need to call reportValue
. The respective implementation will
automatically call reportValue
for you.
The following limits apply to reported values:
- Keys are truncated to 256 characters
- Values are truncated to 256 characters
- Reported values must be JSON serializable or they will be ignored
Last updated on July 24, 2024
Was this helpful?