Retrieve a list of all logs

GET /v1/Services/{ServiceSid}/Environments/{EnvironmentSid}/Logs

A record of an event that occurred related to a function invocation.

Retrieve a list of all logs.

Path parameters

  • ServiceSid string Required

    The SID of the Service to read the Log resource from.

  • EnvironmentSid string Required

    The SID of the environment with the Log resources to read.

Query parameters

  • The SID of the function whose invocation produced the Log resources to read.

  • StartDate string(date-time)

    The date/time (in GMT, ISO 8601) after which the Log resources must have been created. Defaults to 1 day prior to current date/time.

  • EndDate string(date-time)

    The date/time (in GMT, ISO 8601) before which the Log resources must have been created. Defaults to current date/time.

  • PageSize integer

    How many resources to return in each list page. The default is 50, and the maximum is 1000.

    Minimum value is 1, maximum value is 1000.

Responses

  • OK

    Hide response attributes Show response attributes object
    • logs array[object]
      Hide logs attributes Show logs attributes array[object]
      • account_sid string | null

        The SID of the Account that created the Log resource

        Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

      • build_sid string | null

        The SID of the build that corresponds to the log

        Minimum length is 34, maximum length is 34. Format should match the following pattern: ^ZB[0-9a-fA-F]{32}$.

      • date_created string(date-time) | null

        The ISO 8601 date and time in GMT when the Log resource was created

      • deployment_sid string | null

        The SID of the deployment that corresponds to the log

        Minimum length is 34, maximum length is 34. Format should match the following pattern: ^ZD[0-9a-fA-F]{32}$.

      • environment_sid string | null

        The SID of the environment in which the log occurred

        Minimum length is 34, maximum length is 34. Format should match the following pattern: ^ZE[0-9a-fA-F]{32}$.

      • function_sid string | null

        The SID of the function whose invocation produced the log

        Minimum length is 34, maximum length is 34. Format should match the following pattern: ^ZH[0-9a-fA-F]{32}$.

      • level string | null

        The log level

        Values are info, warn, or error.

      • message string | null

        The log message

      • request_sid string | null

        The SID of the request associated with the log

        Minimum length is 34, maximum length is 34. Format should match the following pattern: ^RQ[0-9a-fA-F]{32}$.

      • service_sid string | null

        The SID of the Service that the Log resource is associated with

        Minimum length is 34, maximum length is 34. Format should match the following pattern: ^ZS[0-9a-fA-F]{32}$.

      • sid string | null

        The unique string that identifies the Log resource

        Minimum length is 34, maximum length is 34. Format should match the following pattern: ^NO[0-9a-fA-F]{32}$.

      • url string(uri) | null

        The absolute URL of the Log resource

    • meta object
      Hide meta attributes Show meta attributes object
GET /v1/Services/{ServiceSid}/Environments/{EnvironmentSid}/Logs
curl \
 -X GET https://serverless.twilio.com/v1/Services/{ServiceSid}/Environments/{EnvironmentSid}/Logs \
 --user "username:password"
Response examples (200)
{
  "logs": [
    {
      "account_sid": "string",
      "build_sid": "string",
      "date_created": "2023-05-04T09:42:00+00:00",
      "deployment_sid": "string",
      "environment_sid": "string",
      "function_sid": "string",
      "level": "info",
      "message": "string",
      "request_sid": "string",
      "service_sid": "string",
      "sid": "string",
      "url": "https://example.com"
    }
  ],
  "meta": {
    "first_page_url": "https://example.com",
    "key": "string",
    "next_page_url": "https://example.com",
    "page": 42,
    "page_size": 42,
    "previous_page_url": "https://example.com",
    "url": "https://example.com"
  }
}
Response examples (200)
{
  "logs": [
    {
      "account_sid": "string",
      "build_sid": "string",
      "date_created": "2024-05-04T09:42:00+00:00",
      "deployment_sid": "string",
      "environment_sid": "string",
      "function_sid": "string",
      "level": "info",
      "message": "string",
      "request_sid": "string",
      "service_sid": "string",
      "sid": "string",
      "url": "https://example.com"
    }
  ],
  "meta": {
    "first_page_url": "https://example.com",
    "key": "string",
    "next_page_url": "https://example.com",
    "page": 42,
    "page_size": 42,
    "previous_page_url": "https://example.com",
    "url": "https://example.com"
  }
}