Skip to main content

Logs API

Access container service logs and service status. Available in the all-in-one Docker deployment where supervisord manages services.

Base path: /api/v1/logs


Get All Logs

GET /api/v1/logs

Returns interleaved logs from all managed services (Cortex, Neuron, Nginx, Valkey), sorted by timestamp.

Query Parameters

ParameterTypeRequiredDefaultDescription
linesintegerNoServer defaultNumber of log lines to return (1-10000)

Response

Status: 200 OK

{
"service": null,
"lines": [
"2026-04-13 14:25:30 [cortex] INFO: Application startup complete",
"2026-04-13 14:25:31 [neuron] INFO: Worker started, polling queues",
"2026-04-13 14:25:31 [nginx] 127.0.0.1 - GET /api/v1/health 200"
],
"total_lines": 3
}

curl Example

# Get recent logs from all services
curl -s http://localhost:8080/api/v1/logs

# Get last 100 lines
curl -s "http://localhost:8080/api/v1/logs?lines=100"

Get Service Logs

GET /api/v1/logs/{service_name}

Returns logs for a specific service.

Path Parameters

ParameterTypeRequiredDescription
service_namestringYesService name: cortex, neuron, nginx, or valkey

Query Parameters

ParameterTypeRequiredDefaultDescription
linesintegerNoServer defaultNumber of log lines to return (1-10000)

Response

Status: 200 OK

{
"service": "cortex",
"lines": [
"2026-04-13 14:25:30 INFO: Application startup complete",
"2026-04-13 14:25:35 INFO: Processing request GET /api/v1/health"
],
"total_lines": 2
}

curl Example

curl -s http://localhost:8080/api/v1/logs/cortex
curl -s "http://localhost:8080/api/v1/logs/neuron?lines=50"

Get Service Status

GET /api/v1/logs/status

Returns the status of all managed services including PID, uptime, and state.

Response

Status: 200 OK

{
"available": true,
"services": [
{
"name": "cortex",
"state": "RUNNING",
"pid": 42,
"uptime_seconds": 3600,
"start_time": "2026-04-13T13:25:30.000000",
"description": ""
},
{
"name": "neuron",
"state": "RUNNING",
"pid": 43,
"uptime_seconds": 3600,
"start_time": "2026-04-13T13:25:31.000000",
"description": ""
}
]
}

When supervisord is not reachable (e.g., multi-container deployment):

{
"available": false,
"services": []
}

curl Example

curl -s http://localhost:8080/api/v1/logs/status

Response Models Reference

LogResponse

FieldTypeDescription
servicestring or nullService name filter, null for all services
linesstring[]Log lines
total_linesintegerTotal number of lines returned

ServiceStatusResponse

FieldTypeDescription
availablebooleanWhether supervisord is reachable
servicesServiceStatus[]List of managed services

ServiceStatus

FieldTypeDescription
namestringService name
statestringCurrent state (e.g., RUNNING, STOPPED, FATAL)
pidinteger or nullProcess ID
uptime_secondsinteger or nullSeconds since last start
start_timestring or nullLast start timestamp
descriptionstringAdditional description