Skip to content
Dashboard

Logs REST API

The Logs REST API allows you to retrieve and search through logs from your fal applications. This is essential for debugging, monitoring, and understanding your application’s behavior in production.

Endpoints Overview

EndpointMethodDescription
/logs/POSTList logs with filtering capabilities

Authentication

All requests require authentication using your fal API key:

Terminal window
Authorization: Key $FAL_KEY

List Logs

POST /logs/

Query Parameters

ParameterTypeRequiredDescription
limitintegerNoMaximum number of logs to return (default: 100)
sincestringNoISO 8601 timestamp - logs after this time
untilstringNoISO 8601 timestamp - logs before this time
app_idstringNoFilter by application ID
revisionstringNoFilter by application revision
tracebackbooleanNoInclude traceback information (default: false)
searchstringNoSearch term to filter log messages
levelstringNoMinimum log level (DEBUG, INFO, WARNING, ERROR)
job_idstringNoFilter by job ID
request_idstringNoFilter by request ID

Request Body

ParameterTypeRequiredDescription
extra_filtersarray[LabelFilter]NoAdditional label-based filters

LabelFilter Object

FieldTypeRequiredDescription
keystringYesLabel key to filter on
valuestringYesLabel value to match

Example Request

Terminal window
curl -X POST "https://rest.alpha.fal.ai/logs/?limit=10&app_id=github_5367102-test-startup-timeout" \
-H "Authorization: Key $FAL_KEY" \
-H "Content-Type: application/json" \
-d '{
"extra_filters": [
{
"key": "fal_env",
"value": "prod"
}
]
}'

Response Format

Returns an array of log entry objects:

[
{
"timestamp": "2025-09-19T12:16:10.599608",
"level": "INFO",
"message": "71 seconds of sleep remaining",
"app": "github_5367102-test-startup-timeout",
"revision": "e6a6cf77-e803-4435-a647-7d9100ef79d9",
"labels": {
"app": "github_5367102-test-startup-timeout",
"app_id": "e6a6cf77-e803-4435-a647-7d9100ef79d9",
"fal_env": "prod",
"fal_job_id": "41512b2d-d821-4d62-a98b-9472c9d43941",
"fal_multiplexing_app": "1",
"fal_node_id": "116aaad5-1074-b94c-e056-2b4ed093464a",
"fal_public_logs": "1",
"fal_user_nickname": "efiop",
"fal_worker_id": "fal-jobs/S/41512b2d-d821-4d62-a98b-9472c9d43941",
"isolate_source": "USER",
"level": "INFO",
"logged_at": "2025-09-19T12:16:10.599608+00:00",
"message": "71 seconds of sleep remaining",
"source": "gateway"
}
},
{
"timestamp": "2025-09-19T12:16:09.599522",
"level": "INFO",
"message": "72 seconds of sleep remaining",
"app": "github_5367102-test-startup-timeout",
"revision": "e6a6cf77-e803-4435-a647-7d9100ef79d9",
"labels": {
"app": "github_5367102-test-startup-timeout",
"app_id": "e6a6cf77-e803-4435-a647-7d9100ef79d9",
"fal_env": "prod",
"fal_job_id": "41512b2d-d821-4d62-a98b-9472c9d43941",
"fal_multiplexing_app": "1",
"fal_node_id": "116aaad5-1074-b94c-e056-2b4ed093464a",
"fal_public_logs": "1",
"fal_user_nickname": "efiop",
"fal_worker_id": "fal-jobs/S/41512b2d-d821-4d62-a98b-9472c9d43941",
"isolate_source": "USER",
"level": "INFO",
"logged_at": "2025-09-19T12:16:09.599522+00:00",
"message": "72 seconds of sleep remaining",
"source": "gateway"
}
}
]

Time-based Filtering

When using since and until parameters:

  • Use ISO 8601 format: 2024-01-15T10:30:00Z or 2024-01-15T10:30:00.123Z
  • Times are treated as exclusive bounds (logs after since, logs before until)
  • If no time range is specified, recent logs are returned
  • Consider timezone when specifying times

Example with Time Range

Terminal window
curl -X POST "https://rest.alpha.fal.ai/logs/?since=2024-01-15T09:00:00Z&until=2024-01-15T11:00:00Z&limit=100" \
-H "Authorization: Key $FAL_KEY" \
-H "Content-Type: application/json" \
-d '{}'

Searching Logs

Use the search parameter to find logs containing specific text:

Terminal window
curl -X POST "https://rest.alpha.fal.ai/logs/?search=model%20inference&limit=50" \
-H "Authorization: Key $FAL_KEY" \
-H "Content-Type: application/json" \
-d '{}'

Traceback Information

When traceback=true, error logs will include full Python tracebacks in the labels:

Terminal window
curl -X POST "https://rest.alpha.fal.ai/logs/?level=ERROR&traceback=true" \
-H "Authorization: Key $FAL_KEY" \
-H "Content-Type: application/json" \
-d '{}'

Error Responses

Standard HTTP error responses:

400 Bad Request

{
"detail": "Duplicate label key found: environment"
}

422 Validation Error

{
"detail": [
{
"loc": ["query", "since"],
"msg": "invalid datetime format",
"type": "value_error"
}
]
}