Skip to main content

GET /resources/wrappers//logs

Retrieve log entries from a wrapper’s execution. This is a universal endpoint that reads log files generated by the wrapper during its operation.

Authentication

This endpoint requires authentication. Include your API key in the request headers.

Path Parameters

wrapper_id
string
required
The unique identifier of the wrapper to get logs for

Query Parameters

limit
integer
default:"200"
Maximum number of log lines to return. The most recent lines are returned.

Response

wrapper_id
string
The wrapper ID whose logs were retrieved
logs
array
Array of log line strings. Lines are returned in chronological order (oldest first).
total_lines
integer
Total number of log lines returned

Example Request

cURL
curl -X GET "https://api.example.com/resources/wrappers/550e8400-e29b-41d4-a716-446655440000/logs?limit=50" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example Response

{
  "wrapper_id": "550e8400-e29b-41d4-a716-446655440000",
  "logs": [
    "2026-03-03 10:35:00 - INFO - Wrapper started",
    "2026-03-03 10:35:01 - INFO - Connecting to data source: https://data-api.example.com/climate/temperature",
    "2026-03-03 10:35:02 - INFO - Authentication successful",
    "2026-03-03 10:35:03 - INFO - Fetching historical data from 2026-02-01",
    "2026-03-03 10:35:05 - INFO - Retrieved 127 data points",
    "2026-03-03 10:35:06 - INFO - Sending data to resource res_123456789",
    "2026-03-03 10:35:08 - INFO - Successfully sent 127 data points",
    "2026-03-03 10:35:08 - INFO - Updated high water mark: 2026-03-03T10:39:45Z",
    "2026-03-03 10:35:08 - INFO - Transitioning to continuous phase",
    "2026-03-03 10:35:10 - INFO - Entering polling mode (interval: 60s)",
    "2026-03-03 10:36:10 - INFO - Polling for new data",
    "2026-03-03 10:36:11 - INFO - No new data available",
    "2026-03-03 10:37:10 - INFO - Polling for new data",
    "2026-03-03 10:37:12 - INFO - Retrieved 3 new data points",
    "2026-03-03 10:37:13 - INFO - Successfully sent 3 data points"
  ],
  "total_lines": 15
}

Example Response (Wrapper Not Found)

{
  "wrapper_id": "invalid-wrapper-id",
  "logs": [
    "Error: Wrapper not found"
  ],
  "total_lines": 1
}

Example Response (File System Error)

{
  "wrapper_id": "550e8400-e29b-41d4-a716-446655440000",
  "logs": [
    "Error reading logs: Log file not found"
  ],
  "total_lines": 1
}

Error Responses

500 Internal Server Error
Failed to read log files. Common causes:
  • Log file not found (wrapper may not have started yet)
  • Permission denied reading log files
  • File system I/O error
{
  "detail": "Failed to read log files"
}

Log Format

Log entries typically follow this format:
YYYY-MM-DD HH:MM:SS - LEVEL - Message
Where:
  • Date/Time: Timestamp in UTC
  • LEVEL: Log level (INFO, WARNING, ERROR, DEBUG)
  • Message: Human-readable log message

Common Log Messages

Startup:
  • “Wrapper started”
  • “Connecting to data source”
  • “Authentication successful”
Data Fetching:
  • “Fetching historical data from [date]”
  • “Retrieved [N] data points”
  • “Polling for new data”
  • “No new data available”
Data Transmission:
  • “Sending data to resource [resource_id]”
  • “Successfully sent [N] data points”
  • “Updated high water mark”
Phase Transitions:
  • “Transitioning to continuous phase”
  • “Entering polling mode”
Errors:
  • “Connection error: [details]”
  • “Authentication failed”
  • “Failed to send data: [details]“

Use Cases

  • Debug wrapper execution issues
  • Monitor data collection progress
  • Investigate connection errors
  • Track phase transitions (historical to continuous)
  • Verify data transmission

Build docs developers (and LLMs) love