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

# Get Resource Logs

> Get logs for a resource by provider, resource type, and name.

Proxies log requests to the provider runtime that manages this resource.

Response modes:
    - follow=false (default): Returns a JSON array of LogEntry objects
    - follow=true: Returns an SSE stream of log events

SSE format (when follow=true):
    event: log
    data: {"timestamp": "...", "level": "info", "message": "..."}

Returns:
    List of LogEntry objects (follow=false) or SSE StreamingResponse (follow=true).

Raises:
    HTTPException: 504 on provider timeout, 502 on provider error or connection failure.



## OpenAPI

````yaml https://api.pragmatiks.io/openapi.json get /projects/{project_id}/resources/logs
openapi: 3.1.0
info:
  title: Pragma API
  version: 0.1.0
servers: []
security: []
paths:
  /projects/{project_id}/resources/logs:
    get:
      tags:
        - resources
      summary: Get Resource Logs
      description: |-
        Get logs for a resource by provider, resource type, and name.

        Proxies log requests to the provider runtime that manages this resource.

        Response modes:
            - follow=false (default): Returns a JSON array of LogEntry objects
            - follow=true: Returns an SSE stream of log events

        SSE format (when follow=true):
            event: log
            data: {"timestamp": "...", "level": "info", "message": "..."}

        Returns:
            List of LogEntry objects (follow=false) or SSE StreamingResponse (follow=true).

        Raises:
            HTTPException: 504 on provider timeout, 502 on provider error or connection failure.
      operationId: resources-get_resource_logs
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
            title: Project Id
        - name: provider
          in: query
          required: true
          schema:
            type: string
            description: Provider name
            title: Provider
          description: Provider name
        - name: resource
          in: query
          required: true
          schema:
            type: string
            description: Resource type
            title: Resource
          description: Resource type
        - name: name
          in: query
          required: true
          schema:
            type: string
            description: Resource name
            title: Name
          description: Resource name
        - name: since
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only return logs after this ISO timestamp
            title: Since
          description: Only return logs after this ISO timestamp
        - name: tail
          in: query
          required: false
          schema:
            type: integer
            maximum: 10000
            minimum: 1
            description: Number of recent log entries to return
            default: 100
            title: Tail
          description: Number of recent log entries to return
        - name: follow
          in: query
          required: false
          schema:
            type: boolean
            description: Stream logs in real-time via SSE
            default: false
            title: Follow
          description: Stream logs in real-time via SSE
      responses:
        '200':
          description: Log entries (JSON array or SSE stream)
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LogEntry'
                title: Response Resources-Get Resource Logs
            text/event-stream:
              schema:
                type: string
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    LogEntry:
      properties:
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        level:
          type: string
          title: Level
        message:
          type: string
          title: Message
      type: object
      required:
        - timestamp
        - level
        - message
      title: LogEntry
      description: |-
        A single log entry from a resource.

        Attributes:
            timestamp: ISO-8601 timestamp of when the log was generated.
            level: Log level (debug, info, warning, error).
            message: Log message content.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````