Skip to main content

Logs endpoints

Retrieve logs for your SkillFlaw flows and server.

Enable log retrieval

The /logs and /logs-stream endpoints are only available when the in-memory log buffer is enabled.

To enable log retrieval, set a positive SKILLFLAW_LOG_RETRIEVER_BUFFER_SIZE value in your SkillFlaw .env file. SKILLFLAW_LOG_LEVEL controls the emitted log level.

For example:


_10
SKILLFLAW_LOG_RETRIEVER_BUFFER_SIZE=10000
_10
SKILLFLAW_LOG_LEVEL=DEBUG

If SKILLFLAW_LOG_RETRIEVER_BUFFER_SIZE is 0 or unset, the log endpoints return 501 Not Implemented with Log retrieval is disabled.

Stream logs

Stream logs in real time using Server-Sent Events (SSE):


_10
curl -X GET \
_10
"$SKILLFLAW_URL/logs-stream" \
_10
-H "accept: text/event-stream" \
_10
-H "x-api-key: $SKILLFLAW_API_KEY"

Result

_17
keepalive
_17
_17
{"1736355791151": "2025-01-08T12:03:11.151218-0500 DEBUG Building Chat Input\n"}
_17
_17
{"1736355791485": "2025-01-08T12:03:11.485380-0500 DEBUG consumed event add_message-153bcd5d-ef4d-4ece-8cc0-47c6b6a9ef92 (time in queue, 0.0000, client 0.0001)\n"}
_17
_17
{"1736355791499": "2025-01-08T12:03:11.499704-0500 DEBUG consumed event end_vertex-3d7125cd-7b8a-44eb-9113-ed5b785e3cf3 (time in queue, 0.0056, client 0.0047)\n"}
_17
_17
{"1736355791502": "2025-01-08T12:03:11.502510-0500 DEBUG consumed event end-40d0b363-5618-4a23-bbae-487cd0b9594d (time in queue, 0.0001, client 0.0004)\n"}
_17
_17
{"1736355791513": "2025-01-08T12:03:11.513097-0500 DEBUG Logged vertex build: 729ff2f8-6b01-48c8-9ad0-3743c2af9e8a\n"}
_17
_17
{"1736355791834": "2025-01-08T12:03:11.834982-0500 DEBUG Telemetry data sent successfully.\n"}
_17
_17
{"1736355791941": "2025-01-08T12:03:11.941840-0500 DEBUG Telemetry data sent successfully.\n"}
_17
_17
keepalive

The stream emits keepalive frames when no new logs are available.

Retrieve logs with optional parameters

Retrieve logs with optional query parameters:

  • lines_before: The number of logs before the timestamp or the last log.
  • lines_after: The number of logs after the timestamp.
  • timestamp: The timestamp to start getting logs from.

The default values for all three parameters is 0. With default values, the endpoint returns the last 10 lines of logs.


_10
curl -X GET \
_10
"$SKILLFLAW_URL/logs?lines_before=0&lines_after=0&timestamp=0" \
_10
-H "accept: application/json" \
_10
-H "x-api-key: $SKILLFLAW_API_KEY"

Result

_12
{
_12
"1736354770500": "2025-01-08T11:46:10.500363-0500 DEBUG Creating starter project Document Q&A\n",
_12
"1736354770511": "2025-01-08T11:46:10.511146-0500 DEBUG Creating starter project Image Sentiment Analysis\n",
_12
"1736354770521": "2025-01-08T11:46:10.521018-0500 DEBUG Creating starter project SEO Keyword Generator\n",
_12
"1736354770532": "2025-01-08T11:46:10.532677-0500 DEBUG Creating starter project Sequential Tasks Agents\n",
_12
"1736354770544": "2025-01-08T11:46:10.544010-0500 DEBUG Creating starter project Custom Component Generator\n",
_12
"1736354770555": "2025-01-08T11:46:10.555513-0500 DEBUG Creating starter project Prompt Chaining\n",
_12
"1736354770588": "2025-01-08T11:46:10.588105-0500 DEBUG Create service ServiceType.CHAT_SERVICE\n",
_12
"1736354771021": "2025-01-08T11:46:11.021817-0500 DEBUG Telemetry data sent successfully.\n",
_12
"1736354775619": "2025-01-08T11:46:15.619545-0500 DEBUG Create service ServiceType.STORE_SERVICE\n",
_12
"1736354775699": "2025-01-08T11:46:15.699661-0500 DEBUG File 046-rocket.svg retrieved successfully from flow /Users/USER/Library/Caches/skillflaw/profile_pictures/Space.\n"
_12
}

Parameter behavior

  • If timestamp <= 0 and both counters are 0, SkillFlaw returns the last 10 log lines.
  • If lines_before > 0, SkillFlaw returns lines before the provided timestamp.
  • If lines_after > 0, a valid timestamp is required.
  • You cannot request lines_before > 0 and lines_after > 0 in the same request.

All log endpoints require authentication because logs can contain operational details and sensitive runtime context.