Logs API

System and application log browsing, searching, streaming, and downloading.

All endpoints are prefixed with /api/logs. Admin only.


Endpoints

MethodPathDescription
GET/logsList log files
GET/logs/categoriesLog categories
GET/logs/read/:fileRead log content
GET/logs/tail/:fileTail log (last N lines)
GET/logs/search/:fileSearch in log
POST/logs/search-multiMulti-file search
GET/logs/stream/:fileSSE live stream
GET/logs/download/:fileDownload log file
GET/logs/linecount/:fileCount lines

Request/Response

GET /logs

{
  "files": [
    { "name": "nexuspanel.log", "size": 1234567, "modified": "2026-07-28T12:00:00Z", "category": "application" },
    { "name": "access.log", "size": 4567890, "modified": "2026-07-28T12:00:00Z", "category": "web" }
  ]
}

GET /logs/tail/:file

Params: lines (default: 500)

Returns raw log text.

GET /logs/search/:file

Params: q (query), regex (optional boolean)

{
  "matches": [
    { "line": 42, "content": "2026-07-28 ERROR: Connection refused", "context": "..." }
  ],
  "total": 15
}

GET /logs/stream/:file

Server-Sent Events (SSE) endpoint for live log following.


Part of NexusPanel API Reference

← Back to Documentation