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

# Get application logs

> Get runtime logs (stdout/stderr) emitted by the pods of a deployed application.



## OpenAPI

````yaml /openapi.json get /api/svc/v1/logs
openapi: 3.1.0
info:
  title: TrueFoundry API
  description: API for TrueFoundry
  version: 0.1.0
  contact: {}
servers:
  - url: https://{controlPlaneURL}
    variables:
      controlPlaneURL:
        default: app.truefoundry.com
        description: Control Plane URL
security: []
tags:
  - name: Agent
  - name: Agent Skills
  - name: Applications
  - name: Metrics
  - name: Apply
  - name: Artifacts
  - name: Audit Logs
  - name: Clusters
  - name: Jobs
  - name: Logs
  - name: MCP Servers V2
  - name: MLRepos
  - name: Model Deployments
  - name: Models
  - name: Personal Access Tokens
  - name: Prompts
  - name: Provider Integrations
  - name: SCIM v2
  - name: Secret Groups
  - name: Secrets
  - name: Teams
  - name: Traces
  - name: Users
  - name: Virtual Accounts
  - name: Role Bindings
  - name: Workspaces
paths:
  /api/svc/v1/logs:
    get:
      tags:
        - Logs
      summary: Get application logs
      description: >-
        Get runtime logs (stdout/stderr) emitted by the pods of a deployed
        application.
      operationId: Logs.getApplicationLogs
      parameters:
        - name: startTs
          required: false
          in: query
          description: >-
            Start timestamp for querying logs, in nanoseconds from the Unix
            epoch.
          schema:
            nullable: true
            example: '1779262323000000000'
            type: string
        - name: endTs
          required: false
          in: query
          description: End timestamp for querying logs, in nanoseconds from the Unix epoch.
          schema:
            nullable: true
            example: '1779348723000000000'
            type: string
        - name: limit
          required: false
          in: query
          description: Maximum number of log lines to fetch.
          schema:
            nullable: true
            default: 5000
            type: integer
        - name: direction
          required: false
          in: query
          description: Direction of sorting logs by timestamp.
          schema:
            $ref: '#/components/schemas/LogsSortingDirection'
        - name: numLogsToIgnore
          required: false
          in: query
          description: Number of log lines at the start timestamp to skip.
          schema:
            type: integer
            nullable: true
        - name: applicationId
          required: false
          in: query
          description: >-
            Unique identifier of the application. Either applicationId or
            applicationFqn must be provided.
          schema:
            type: string
            nullable: true
        - name: applicationFqn
          required: false
          in: query
          description: >-
            FQN of the application. Either applicationId or applicationFqn must
            be provided.
          schema:
            type: string
            nullable: true
        - name: deploymentId
          required: false
          in: query
          description: Unique identifier of the deployment.
          schema:
            type: string
            nullable: true
        - name: jobRunName
          required: false
          in: query
          description: Name of the job run whose logs to fetch.
          schema:
            type: string
            nullable: true
        - name: podName
          required: false
          in: query
          description: >-
            Name of a single pod whose logs to fetch. Cannot be used together
            with podNames or podNamesRegex.
          schema:
            type: string
            nullable: true
        - name: containerName
          required: false
          in: query
          description: Name of the container whose logs to fetch.
          schema:
            type: string
            nullable: true
        - name: podNames
          required: false
          in: query
          description: >-
            List of pod names whose logs to fetch. Cannot be used together with
            podName or podNamesRegex.
          schema:
            nullable: true
            type: array
            items:
              type: string
        - name: podNamesRegex
          required: false
          in: query
          description: >-
            Regex pattern matching pod names whose logs to fetch. Cannot be used
            together with podName or podNames.
          schema:
            type: string
            nullable: true
        - name: searchFilters
          required: false
          in: query
          description: >-
            JSON-encoded array of search filters; each item is `{ string, type,
            operator }`. Takes precedence over `searchString` when provided.
          schema:
            nullable: true
            example: '[{"string":"error","type":"substring","operator":"equal"}]'
            type: string
        - name: searchString
          required: false
          in: query
          description: >-
            Substring or regex to match against log content. Used when
            `searchFilters` is not provided.
          schema:
            type: string
            nullable: true
        - name: searchType
          required: false
          in: query
          description: How `searchString` should be matched against log content.
          schema:
            $ref: '#/components/schemas/LogsSearchFilterType'
        - name: searchOperator
          required: false
          in: query
          description: Comparison operator applied to the `searchString` match.
          schema:
            $ref: '#/components/schemas/LogsSearchOperatorType'
      responses:
        '200':
          description: Logs matching the query parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetLogsResponse'
        '400':
          description: >-
            Bad Request. This can happen due to: 

            1. Invalid workspace id 

            2. Only one of podName, podNames, or podNamesRegex can be passed in
            query, not multiple
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
      security:
        - jwt: []
components:
  schemas:
    LogsSortingDirection:
      type: string
      enum:
        - asc
        - desc
      title: LogsSortingDirection
      x-fern-type-name: LogsSortingDirection
    LogsSearchFilterType:
      type: string
      enum:
        - regex
        - substring
        - ignore_case_substring
      description: Query filter type for logs search
      title: LogsSearchFilterType
      x-fern-type-name: LogsSearchFilterType
    LogsSearchOperatorType:
      type: string
      enum:
        - equal
        - not_equal
      description: Comparison operator logs search
      title: LogsSearchOperatorType
      x-fern-type-name: LogsSearchOperatorType
    GetLogsResponse:
      type: object
      properties:
        data:
          description: List of logs
          type: array
          items:
            $ref: '#/components/schemas/Log'
      required:
        - data
      title: GetLogsResponse
      x-fern-type-name: GetLogsResponse
    HttpError:
      type: object
      properties:
        statusCode:
          type: integer
          description: HTTP Status Code
        message:
          type: string
          description: Error Message
        code:
          oneOf:
            - type: integer
            - type: string
          description: Error code
          nullable: true
        details:
          type: array
          description: Error details
          items:
            type: object
          nullable: true
      required:
        - statusCode
        - message
      title: HttpError
      x-fern-type-name: HttpError
    Log:
      type: object
      properties:
        job_name:
          type: string
          description: Name of the job.
          nullable: true
        log:
          type: string
          description: Log line content.
        stream:
          type: string
          description: Log stream name.
          example: stdout
        time:
          type: string
          description: Log timestamp in nanoseconds from the Unix epoch.
          example: '1635467890123456789'
        containerName:
          type: string
          description: Name of the container that emitted the log.
          nullable: true
      required:
        - log
        - stream
        - time
      title: Log
      x-fern-type-name: Log
  securitySchemes:
    jwt:
      type: http
      scheme: bearer
      bearerFormat: JWT

````