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

# List the Log Lines a Device has sent

> The log lines this device sent over the logging extension, newest first.

Lines stay readable after the extension is turned off for the product or
the device — the setting governs what arrives, not what can be read. They
are not kept forever, though: log lines are dropped three days after they
were logged.

To page back through history, ask for a `limit` and then pass the
`timestamp` of the oldest line you received as the next request's
`before`.




## OpenAPI

````yaml https://manage.nervescloud.com/api/openapi get /api/orgs/{org_name}/products/{product_name}/devices/{identifier}/logs
openapi: 3.0.0
info:
  description: >
    The NervesCloud API gives users full access to their

    Orgs, Products, and corresponding Device fleets.


    The API can be used to integrate with your own systems, providing full
    access to your Product and Device data.


    The API is documented using the OpenAPI 3.0 specification.
  title: NervesCloud API
  version: 2.0.0
servers:
  - url: https://manage.nervescloud.com
    variables: {}
security:
  - bearer_auth: []
tags:
  - description: User authentication and API token creation
    name: Auth
  - description: Organization Certificate Authority management
    name: CA Certificates
  - description: >-
      Device management, including action requests eg. upgrade, reboot,
      reconnect
    name: Devices
  - description: Log lines Devices have sent over the logging extension
    name: Device Logs
  - description: >-
      Device management, including action requests eg. upgrade, reboot,
      reconnect
    name: Devices (short URL)
  - description: Device Certificate management
    name: Device Certificates
  - description: Identities a Device holds on networks NervesHub does not run
    name: Network Identities
  - description: Deployment Group and release management
    name: Deployment Groups
  - description: Firmware uploading and management
    name: Firmwares
  - description: Organization iroh endpoint id registration
    name: Iroh Endpoints
  - description: Organization management
    name: Organizations
  - description: Organization User membership management
    name: Organization Members
  - description: Product management
    name: Products
  - description: Organization Signing Key management
    name: Signing Keys
  - description: Product Support Script management
    name: Support Scripts
  - description: Platform healthcheck
    name: Platform Status
paths:
  /api/orgs/{org_name}/products/{product_name}/devices/{identifier}/logs:
    get:
      tags:
        - Device Logs
      summary: List the Log Lines a Device has sent
      description: >
        The log lines this device sent over the logging extension, newest first.


        Lines stay readable after the extension is turned off for the product or

        the device — the setting governs what arrives, not what can be read.
        They

        are not kept forever, though: log lines are dropped three days after
        they

        were logged.


        To page back through history, ask for a `limit` and then pass the

        `timestamp` of the oldest line you received as the next request's

        `before`.
      operationId: NervesHubWeb.API.DeviceLogController.index.long
      parameters:
        - description: Organization Name
          example: example_org
          in: path
          name: org_name
          required: true
          schema:
            type: string
        - description: Product Name
          example: example_product
          in: path
          name: product_name
          required: true
          schema:
            type: string
        - description: Device Identifier
          example: abc123
          in: path
          name: identifier
          required: true
          schema:
            type: string
        - description: >-
            Only lines logged at these levels. Comma separated for more than
            one. Matched as given — a level no device has logged at matches
            nothing
          example: error,warning
          in: query
          name: level
          required: false
          schema:
            type: string
        - description: >-
            Only lines whose message contains this text, ignoring case. Matched
            literally, so `%` and `_` are searched for rather than treated as
            wildcards
          example: sensor bus
          in: query
          name: search
          required: false
          schema:
            type: string
        - description: Only lines logged at or after this ISO 8601 timestamp
          example: '2026-08-16T09:00:00Z'
          in: query
          name: since
          required: false
          schema:
            format: date-time
            type: string
        - description: >-
            Only lines logged strictly before this ISO 8601 timestamp. To page
            back through history, pass the timestamp of the oldest line you
            received
          example: '2026-08-16T09:14:00.123456Z'
          in: query
          name: before
          required: false
          schema:
            format: date-time
            type: string
        - description: How many lines to return, from 1 to 1000
          example: '250'
          in: query
          name: limit
          required: false
          schema:
            default: 100
            type: integer
        - description: '`desc` for newest first, `asc` for oldest first'
          example: asc
          in: query
          name: order
          required: false
          schema:
            default: desc
            enum:
              - desc
              - asc
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceLogListResponse'
          description: Device Log List Response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unusable query parameter
        '501':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: This platform has no analytics database, so no logs are stored
      callbacks: {}
      deprecated: false
      security:
        - bearer_auth: []
components:
  schemas:
    DeviceLogListResponse:
      description: Device log list response
      example:
        data:
          - level: error
            message: Failed to reach the sensor bus
            meta:
              file: lib/thermostat/sensors.ex
              line: '42'
            timestamp: '2026-08-16T09:14:00.123456Z'
          - level: info
            message: Starting sensor poll
            meta: {}
            timestamp: '2026-08-16T09:13:59.998211Z'
      properties:
        data:
          description: The matching log lines, newest first unless `order=asc` was given
          items:
            $ref: '#/components/schemas/DeviceLogLine'
          type: array
      title: DeviceLogListResponse
      type: object
    ErrorResponse:
      description: Error response
      example:
        errors:
          detail: Resource Not Found or Authorization Insufficient
      properties:
        errors:
          properties:
            detail:
              type: string
          type: object
      title: ErrorResponse
      type: object
    DeviceLogLine:
      description: A log line a device sent over the logging extension
      example:
        level: error
        message: Failed to reach the sensor bus
        meta:
          file: lib/thermostat/sensors.ex
          line: '42'
        timestamp: '2026-08-16T09:14:00.123456Z'
      properties:
        level:
          description: >-
            The level the device logged at. Usually an Elixir Logger level —
            debug, info, notice, warning, error, critical, alert, emergency —
            but a device can log at any level it likes
          example: error
          type: string
        message:
          description: The logged message
          type: string
        meta:
          additionalProperties:
            type: string
          description: >-
            The Logger metadata the device attached to the line, flattened to
            strings
          type: object
        timestamp:
          description: When the device logged the line, to microsecond precision
          format: date-time
          type: string
      title: DeviceLogLine
      type: object
  securitySchemes:
    bearer_auth:
      scheme: bearer
      type: http

````