Updated

Logs API error: Table "<name>" does not exist

Error: Table "<name>" does not exist

When calling /v1/projects/{ref}/analytics/endpoints/logs, the API may return:

{"error": "Table \"<name>\" does not exist."}

Cause: Your SQL query references an individual log source (such as edge_logs or function_logs) directly in the FROM clause. You need to use the unified logs table instead.

Resolution

Query the logs table and filter by the source column.

Before:

SELECT count(*) AS n FROM function_logs;

After:

SELECT count(*) AS n FROM logs WHERE source = 'function_logs';

Example request:

https://api.supabase.com/v1/projects/{project_ref}/analytics/endpoints/logs?sql=select%20count(*)%20as%20n%20from%20logs%20where%20source%3D'function_logs'

Supported source values

SourceDescription
edge_logsHTTP requests through the API gateway, including REST and GraphQL
postgres_logsDatabase activity, statements, and errors
postgrest_logsPostgREST server logs
auth_logsAuth server: login, JWT, OAuth, email
auth_audit_logsAuth audit events
storage_logsStorage API: uploads and object access
realtime_logsRealtime server: channels, presence, broadcast
function_edge_logsHTTP request and response for an Edge Function invocation
function_logsConsole output from inside an Edge Function
supavisor_logsShared pooler: pooling and timeouts
pgbouncer_logsDedicated pooler
pg_upgrade_logsDatabase version upgrade

Go to the GitHub discussion