> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get function logs

> Returns logs oldest first. `type=runtime` (default) returns function stdout/stderr. `type=invocations` returns one platform-generated record per HTTP request served.



## OpenAPI

````yaml /openapi/source/external/edge-compute/functions-observability.json get /compute/funcs/{id}/logs
openapi: 3.1.0
info:
  title: Edge Compute Function Observability API
  description: >-
    Customer-facing Edge Compute function logs, metrics, deployment history, and
    ship inspection.
  version: '1.0'
  x-latency-category: responsive
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /compute/funcs/{id}/logs:
    get:
      tags:
        - functions
      summary: Get function logs
      description: >-
        Returns logs oldest first. `type=runtime` (default) returns function
        stdout/stderr. `type=invocations` returns one platform-generated record
        per HTTP request served.
      operationId: GetComputeFunctionLogs
      parameters:
        - name: id
          in: path
          required: true
          description: Function ID
          schema:
            type: string
        - name: type
          in: query
          required: false
          description: Log stream to return.
          schema:
            type: string
            enum:
              - runtime
              - invocations
            default: runtime
        - name: start_time
          in: query
          required: false
          description: Return records at or after this RFC 3339 timestamp.
          schema:
            type: string
            format: date-time
        - name: end_time
          in: query
          required: false
          description: Return records at or before this RFC 3339 timestamp.
          schema:
            type: string
            format: date-time
        - name: limit
          in: query
          required: false
          description: Maximum records to return.
          schema:
            type: integer
            minimum: 1
            maximum: 250
      responses:
        '200':
          description: Logs retrieved successfully
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/FuncRuntimeLogsResponse'
                  - $ref: '#/components/schemas/FuncInvocationLogsResponse'
              examples:
                runtime:
                  value:
                    meta:
                      has_more: false
                      partial: false
                    data:
                      - record_type: compute_func_runtime_log
                        timestamp: '2026-09-09T16:00:00.000Z'
                        level: log
                        message: Hello from Edge Compute!
                invocations:
                  value:
                    meta:
                      has_more: false
                      partial: false
                    data:
                      - record_type: compute_func_invocation_log
                        timestamp: '2026-09-09T16:00:01.000Z'
                        method: GET
                        path: /health
                        status_code: 200
                        duration_ms: 2.276
                        request_size_bytes: 0
                        response_size_bytes: 19
                        region: us-east-1
        '400':
          description: Invalid query parameter
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '404':
          description: Function not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '422':
          description: Invalid function ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Telnyx from 'telnyx';

            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.compute.funcs.retrieveLogs('id');

            console.log(response.data);
        - lang: Python
          source: |
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            response = client.compute.funcs.retrieve_logs(
                "id",
            )
            print(response.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Compute.Funcs.GetLogs(\n\t\tcontext.TODO(),\n\t\t\"id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Data)\n}\n"
        - lang: Java
          source: |-
            package com.telnyx.sdk.example;

            import com.telnyx.sdk.client.TelnyxClient;
            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    var response = client.compute().funcs().retrieveLogs("id");
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

            telnyx = Telnyx::Client.new(api_key: "My API Key")

            response = telnyx.compute.funcs.retrieve_logs("id")

            puts(response)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Telnyx\Client;

            use Telnyx\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API
            Key');


            try {
              $response = $client->compute->funcs->retrieveLogs(
                'id',
              );

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx compute:funcs retrieve-logs \
              --api-key 'My API Key' \
              --id id
components:
  schemas:
    FuncRuntimeLogsResponse:
      type: object
      properties:
        meta:
          $ref: '#/components/schemas/LogsMeta'
        data:
          type: array
          items:
            $ref: '#/components/schemas/FuncRuntimeLog'
    FuncInvocationLogsResponse:
      type: object
      properties:
        meta:
          $ref: '#/components/schemas/LogsMeta'
        data:
          type: array
          items:
            $ref: '#/components/schemas/FuncInvocationLog'
    Errors:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
    LogsMeta:
      type: object
      properties:
        has_more:
          type: boolean
        partial:
          type: boolean
    FuncRuntimeLog:
      type: object
      properties:
        record_type:
          type: string
          const: compute_func_runtime_log
        timestamp:
          type: string
          format: date-time
        level:
          type: string
        message:
          type: string
    FuncInvocationLog:
      type: object
      properties:
        record_type:
          type: string
          const: compute_func_invocation_log
        timestamp:
          type: string
          format: date-time
        method:
          type: string
        path:
          type: string
        status_code:
          type: integer
        duration_ms:
          type: number
        request_size_bytes:
          type: integer
        response_size_bytes:
          type: integer
        region:
          type: string
    Error:
      type: object
      properties:
        code:
          type: string
        title:
          type: string
        detail:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````