Skip to content

Logs

TorrPlay keeps the most recent log entries in an in-memory circular ring buffer, providing a quick way to inspect recent application events without requiring filesystem access. This approach is particularly useful for containerized deployments or when direct access to log files may be restricted.

Getting Logs

Endpoint: GET /api/system/logs

Returns: JSON array of recent log entries, newest first

ParameterTypeRequiredDescription
qstringNoCase-insensitive search in messages and structured fields
levelstringNoExact level: DEBUG, INFO, WARN, or ERROR

When authentication is enabled, this endpoint requires the same credentials as other protected API requests. See Authentication.

Retention & Configuration

SettingDefaultMaximumDescription
log_store_size1001000Number of log entries retained in the ring buffer; set to 0 to disable in-memory storage
log_levelINFO—Minimum log level to capture (DEBUG, INFO, WARN, ERROR)
log_formattext—Output format for stdout: text or json for structured logging

Log Entry Fields

Each entry in the returned JSON array contains the following fields:

FieldTypeDescription
timestringISO 8601 timestamp of the event
levelstringLog level: DEBUG, INFO, WARN, or ERROR
messagestringHuman-readable log message
dataobjectOptional structured key-value data; omitted if empty

Example Response

[
  {
    "time": "2026-01-01T12:00:01Z",
    "level": "DEBUG",
    "message": "streaming is active, pausing background downloader"
  },
  {
    "time": "2026-01-01T12:00:00Z",
    "level": "INFO",
    "message": "stopping background downloader"
  }
]

Filter the retained entries without reading log files from disk. With Bearer authentication, replace -u with -H "Authorization: Bearer your-jwt-token"; with authentication disabled, omit it:

curl -u your-username:your-password "http://localhost:8090/api/system/logs?level=ERROR&q=storage"

Adjusting Verbosity & Retention

Set log_level to DEBUG to capture verbose diagnostic output:

curl -X PATCH http://localhost:8090/api/v1/settings \
  -H "Content-Type: application/json" \
  -d '{"log_level": "DEBUG", "log_store_size": 500}'

Enable structured JSON logging to stdout (useful when aggregating logs with external tooling such as Loki or Fluentd):

curl -X PATCH http://localhost:8090/api/v1/settings \
  -H "Content-Type: application/json" \
  -d '{"log_format": "json"}'
Last updated on