Platform

Logs & observability

Inspect SQL statements, auth events and edge function runs for a project, filter and search them, find slow queries, and export logs as JSON or CSV.

OrbitNest records a structured log entry for SQL statements, end-user auth events and edge function executions in every project. Browse them in the Studio Logs tab, or query them over the REST API and the MCP server.

What gets logged

Each entry in the main project log has an event_type, a log_level, an event_subtype (a short message such as operation_executed), a timestamp and a metadata object.

event_typeRecorded whenLevels
databaseA SQL statement runs through OrbitNest's SQL execution path: the Studio SQL editor, POST /api/project/:slug/database/sql, the structured POST /api/project/:slug/database/query endpoint, and the CLI and MCP SQL toolsinfo on success, error on failure
authAn end-user email OTP flow step runs: sign-up requested, verified or failed, sign-in OTP requested or failed, password recovery requested, password reset completed or failedinfo on success, warn on failure
edge_functionAn edge function runs, whether invoked over HTTP or by a background jobinfo on success, error on error or timeout

Table-data reads and row create, update and delete endpoints (what the SDK query builders use) are not logged individually. Storage operations are not logged.

The log schema also accepts the debug level and a system event type, but nothing writes them today.

Per-type detail

Each type also keeps a detailed record that the type-specific views and endpoints return:

  • Database: the SQL text, table name, operation type (SELECT, INSERT, CREATE_TABLE, ...), rows affected, execution time in ms, success flag, and any error message.
  • Auth: the project's own auth audit log, stored in the project database. It covers every sign-in method, including password, SMS and MFA. Its event_type values are listed in Auth events.
  • Edge functions: status (success, error or timeout), duration, request method and path, response status, error message and stack, and a cold-start flag. Console output (console.log, info, warn and error) is stored per execution.

Redaction

Before SQL text is stored, OrbitNest masks values assigned to names like password, secret, token or key, and string literals that contain those words or an email address. Stored SQL is cut off at 2,000 characters. Line breaks and control characters in IP addresses and user agents are replaced with spaces.

Caution

Redaction is pattern-based. Pass sensitive values as query parameters, not as SQL literals, so they never reach the log.

Auth events

The Auth view reads these event_type values from the project's auth audit log:

EventMeaning
signup_requestedA sign-up started (email OTP or password)
signup_completedA sign-up was verified
signin_requestedA sign-in OTP was requested
signin_completedA sign-in succeeded (traits.method is email_otp, password, password+totp or sms_otp)
signin_failedA password sign-in failed
mfa_challenge_issuedA password sign-in now needs a TOTP code
mfa_failedA TOTP or recovery code was rejected
mfa_recovery_usedA recovery code was used
password_recovery_requestedA password reset was requested
password_reset_completedA password reset succeeded

Logs in Studio

Open a project and select Logs. Use the view menu in the header to switch between views:

ViewShows
All LogsThe main project log, all types, newest first
DatabaseDatabase operation records
AuthThe project's auth audit log
FunctionsEdge function execution records
Slow QueriesDatabase statements slower than 1,000 ms (see Slow queries)
ErrorsFailed database operations
Auth FailuresAuth audit events whose type contains fail, such as signin_failed and mfa_failed

The header also has:

  • Search: type a term and press Enter.
  • Filters: event type, log level, and a start and end date. Filters and search apply to the All Logs view.
  • Refresh: reloads the current view.
  • Export: downloads JSON or CSV.

Click the eye icon on a row to open its details: message, SQL, metadata, and IDs such as user, request and execution ID.

Search and filters

The main log endpoint accepts these query parameters:

ParameterDescription
levelOne or more of info, warn, error, comma-separated
event_typeOne or more of database, auth, edge_function, comma-separated
start_time, end_timeISO 8601 timestamps, inclusive. startTime and endTime are accepted as aliases; the snake_case names win if both are sent.
user_idOnly entries for this user
searchCase-insensitive substring match on the event subtype, the error message and the metadata (which includes the SQL text)
limit1–1000, default 100
offsetDefault 0
Terminal
curl "https://api.orbitnest.io/api/projects/$PROJECT_ID/logs?level=error&event_type=database&search=posts&limit=50" \
  -H "Authorization: Bearer $ORBITNEST_ADMIN_TOKEN"
JSON
{
  "success": true,
  "data": [
    {
      "id": "5b1e…",
      "log_level": "error",
      "event_type": "database",
      "event_subtype": "operation_executed",
      "source_table": "posts",
      "operation_type": "SELECT",
      "duration_ms": 4,
      "error_message": "column \"titel\" does not exist",
      "metadata": { "sql_query": "SELECT titel FROM posts", "rows_affected": 0 },
      "created_at": "2026-10-10T09:14:03.120Z"
    }
  ],
  "total": 1,
  "has_more": false,
  "limit": 50,
  "offset": 0,
  "filters": { "level": ["error"], "event_type": "database", "search": "posts", "limit": 50 }
}

total is the exact number of entries that match the filters across all pages. has_more is true when entries remain after this page. Page through results with offset.

A failed query returns a 5xx error, not 400. 400 is only for invalid parameters.

Admin access only

Log endpoints take your Studio admin JWT, not a project API key. The caller must belong to the workspace that owns the project. $PROJECT_ID is the project UUID from the Studio URL (/projects/<id>/...).

REST endpoints

All paths are relative to https://api.orbitnest.io/api/projects/:projectId/logs.

Method and pathReturnsExtra filters
GET /Main project logSee Search and filters
GET /statsAggregate countsNone
GET /databaseDatabase operation recordstable_name, operation_type (for example SELECT), success, slow_query=true (only statements over 1,000 ms), start_time, end_time
GET /database/slowSlow statementstable_name, operation_type, start_time, end_time
GET /database/errorsFailed database operationstable_name, operation_type, start_time, end_time
GET /authAuth audit logevent_type (comma-separated list), user_id, success, search, ip_address, start_time, end_time
GET /auth/failuresAuth events whose type contains failSame as /auth
GET /auth/securityAuth events matching banned, locked, failed or securitySame as /auth, except search
GET /edge-functionsEdge function executionsfunction_name, status (success, error or timeout), start_time, end_time
GET /edge-functions/:functionName/errorsExecutions of one function with status=errorstart_time, end_time
GET /edge-functions/:functionName/consoleConsole output for one execution, in orderexecution_id (required)
GET /exportFile downloadSee Export

Every list endpoint accepts limit (1–1000, default 100) and offset, and returns the same envelope as the main log, with an exact total and has_more. An unknown query parameter returns 400.

On /auth:

  • success=false returns events whose type contains fail, and success=true the rest. The auth audit log has no separate success column.
  • search matches the event type and the event traits, case-insensitively. Separate several terms with |, as in search=failed|locked, to match any of them.
  • ip_address matches the client IP exactly.

function_name on /edge-functions matches the function name case-insensitively.

Slow queries

GET /database/slow returns database statements whose execution time was over 1,000 ms, newest first. The threshold is applied in the query, so paging with limit and offset reaches every slow statement on record, not only recent ones. GET /database?slow_query=true does the same. Each record includes the SQL text, table, operation type, rows affected and execution_time_ms.

Terminal
curl "https://api.orbitnest.io/api/projects/$PROJECT_ID/logs/database/slow?limit=500" \
  -H "Authorization: Bearer $ORBITNEST_ADMIN_TOKEN"

Execution plans are not captured. To investigate a slow statement, run EXPLAIN ANALYZE on it in the SQL editor.

Log stats

GET /stats returns all-time counts from the main project log. If the counts can't be read, it returns 500 rather than zeros.

JSON
{
  "total": 18234,
  "by_level": { "info": 17410, "warn": 512, "error": 312 },
  "by_event_type": [
    { "type": "database", "count": 15020 },
    { "type": "edge_function", "count": 2702 },
    { "type": "auth", "count": 512 }
  ]
}

Export

GET /export downloads up to the 10,000 most recent matching entries of the main project log as a file named logs-<projectId>-<date>.json or .csv. When the export hits that cap, the response has the header X-Export-Truncated: true; narrow the time range to get the rest.

ParameterDescription
formatjson (default) or csv
start_time, end_timeISO 8601 timestamps (startTime and endTime also work)
event_typeOne or more of database, auth, edge_function, comma-separated
level, user_id, searchSame as on the main log endpoint

Export accepts every parameter the list endpoints accept, so you can pass your current view's filters. limit and offset are ignored, and parameters the main log doesn't use, such as table_name, have no effect.

Terminal
curl -OJ "https://api.orbitnest.io/api/projects/$PROJECT_ID/logs/export?format=csv&event_type=edge_function&start_time=2026-10-01T00:00:00Z" \
  -H "Authorization: Bearer $ORBITNEST_ADMIN_TOKEN"

In CSV exports, objects are written as JSON. Cells starting with =, +, -, @, a tab or a carriage return get a leading ' so spreadsheet apps don't run them as formulas.

Function logs

Each function also has its own log, with console output attached to every execution. In Studio, open the function under Functions and select the Logs tab. Over the API, use GET /api/projects/:projectId/functions/:name/logs?limit=50. See Edge functions for details.

Logs from the MCP server

The MCP server exposes the log endpoints as tools. Each tool uses the active project unless you pass a projectId.

ToolDoes
orbitnest_query_logsQueries logs. logType is all (default), database, auth or edge-functions. With all, you can also pass level (info, warn or error), search, limit and offset. The other types accept only limit
orbitnest_get_slow_queriesReturns statements over 1,000 ms (limit)
orbitnest_get_log_statsReturns the counts from /stats
orbitnest_export_logsExports logs as json or csv (format)
orbitnest_get_function_logsReturns execution logs for one function (functionName, limit)

Data lifetime

Log entries are deleted with their project. The auth audit log lives in the project database and is removed when the project is deleted. No automatic time-based retention is configured for logs, so export what you need for long-term analysis.