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_type | Recorded when | Levels |
|---|---|---|
database | A 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 tools | info on success, error on failure |
auth | An 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 failed | info on success, warn on failure |
edge_function | An edge function runs, whether invoked over HTTP or by a background job | info 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_typevalues are listed in Auth events. - Edge functions: status (
success,errorortimeout), duration, request method and path, response status, error message and stack, and a cold-start flag. Console output (console.log,info,warnanderror) 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:
| Event | Meaning |
|---|---|
signup_requested | A sign-up started (email OTP or password) |
signup_completed | A sign-up was verified |
signin_requested | A sign-in OTP was requested |
signin_completed | A sign-in succeeded (traits.method is email_otp, password, password+totp or sms_otp) |
signin_failed | A password sign-in failed |
mfa_challenge_issued | A password sign-in now needs a TOTP code |
mfa_failed | A TOTP or recovery code was rejected |
mfa_recovery_used | A recovery code was used |
password_recovery_requested | A password reset was requested |
password_reset_completed | A password reset succeeded |
Logs in Studio
Open a project and select Logs. Use the view menu in the header to switch between views:
| View | Shows |
|---|---|
| All Logs | The main project log, all types, newest first |
| Database | Database operation records |
| Auth | The project's auth audit log |
| Functions | Edge function execution records |
| Slow Queries | Database statements slower than 1,000 ms (see Slow queries) |
| Errors | Failed database operations |
| Auth Failures | Auth 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:
| Parameter | Description |
|---|---|
level | One or more of info, warn, error, comma-separated |
event_type | One or more of database, auth, edge_function, comma-separated |
start_time, end_time | ISO 8601 timestamps, inclusive. startTime and endTime are accepted as aliases; the snake_case names win if both are sent. |
user_id | Only entries for this user |
search | Case-insensitive substring match on the event subtype, the error message and the metadata (which includes the SQL text) |
limit | 1–1000, default 100 |
offset | Default 0 |
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"{
"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 path | Returns | Extra filters |
|---|---|---|
GET / | Main project log | See Search and filters |
GET /stats | Aggregate counts | None |
GET /database | Database operation records | table_name, operation_type (for example SELECT), success, slow_query=true (only statements over 1,000 ms), start_time, end_time |
GET /database/slow | Slow statements | table_name, operation_type, start_time, end_time |
GET /database/errors | Failed database operations | table_name, operation_type, start_time, end_time |
GET /auth | Auth audit log | event_type (comma-separated list), user_id, success, search, ip_address, start_time, end_time |
GET /auth/failures | Auth events whose type contains fail | Same as /auth |
GET /auth/security | Auth events matching banned, locked, failed or security | Same as /auth, except search |
GET /edge-functions | Edge function executions | function_name, status (success, error or timeout), start_time, end_time |
GET /edge-functions/:functionName/errors | Executions of one function with status=error | start_time, end_time |
GET /edge-functions/:functionName/console | Console output for one execution, in order | execution_id (required) |
GET /export | File download | See 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=falsereturns events whose type containsfail, andsuccess=truethe rest. The auth audit log has no separate success column.searchmatches the event type and the event traits, case-insensitively. Separate several terms with|, as insearch=failed|locked, to match any of them.ip_addressmatches 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.
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.
{
"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.
| Parameter | Description |
|---|---|
format | json (default) or csv |
start_time, end_time | ISO 8601 timestamps (startTime and endTime also work) |
event_type | One or more of database, auth, edge_function, comma-separated |
level, user_id, search | Same 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.
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.
| Tool | Does |
|---|---|
orbitnest_query_logs | Queries 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_queries | Returns statements over 1,000 ms (limit) |
orbitnest_get_log_stats | Returns the counts from /stats |
orbitnest_export_logs | Exports logs as json or csv (format) |
orbitnest_get_function_logs | Returns 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.