Skip to main content

Logs endpoints

Retrieve logs for your Langflow flow.

Enable log retrieval

The /logs endpoint requires log retrieval to be enabled in your Langflow instance.

  1. To enable log retrieval, include these values in your .env file:


    _10
    LANGFLOW_ENABLE_LOG_RETRIEVAL=true
    _10
    LANGFLOW_LOG_RETRIEVER_BUFFER_SIZE=10000
    _10
    LANGFLOW_LOG_LEVEL=DEBUG

    Log retrieval requires that LANGFLOW_LOG_RETRIEVER_BUFFER_SIZE is greater than 0. The default value is 10000.

  2. Start Langflow with the updated .env:


    _10
    uv run langflow run --env-file .env

Stream logs

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


_10
curl -X GET \
_10
"$LANGFLOW_URL/logs-stream" \
_10
-H "accept: text/event-stream"

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
"$LANGFLOW_URL/logs?lines_before=0&lines_after=0&timestamp=0" \
_10
-H "accept: application/json"

Search