Integrate flags with Runtime Logs

Integrate your feature flag provider with runtime logs.
Table of Contents

Feature Flags are available in Beta on all plans

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
Feature Flags section in runtime logs

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:

Next.js (/app)
Next.js (/pages)
import { reportValue } from '@vercel/flags';
// force dynamic mode so the flag actually gets reported,
// otherwise the route would be static
export const dynamic = 'force-dynamic';
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 June 21, 2024