Log Viewer endpoints (Admin API)
4 FeatherPanel Admin API endpoints from admin/log-viewer.php: methods, paths, auth, permissions, rate limits, parameters and responses.
Last synced from FeatherPanel 15b94e9 on .
On this page
Defined in backend/app/routes/admin/log-viewer.php. Authentication used here: Admin. Read Authentication for how to send credentials and Rate limits and errors for the response envelope.
Paths, methods, permissions and rate limits come from the route file. Summaries, parameters and response codes come from the OpenAPI annotations on the controllers; endpoints without annotations show only what the route file declares.
Endpoints
GET/api/admin/log-viewer/get
Get log content Retrieve the last N lines from a specific log file. Only available in developer mode and requires ADMIN_ROOT permissions.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
type | query | string | no | Log type to retrieve |
lines | query | integer | no | Number of lines to retrieve from the end of the log file |
Response data: LogContent
Response data field | Type | Description |
|---|---|---|
logs | string | Log content as string |
file | string | Log file name |
type | string | Log type |
lines_count | integer | Number of lines in the log content |
curl -X GET "$PANEL_URL/api/admin/log-viewer/get" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json"Responses: 200 Log content retrieved successfully · 401 Unauthorized · 403 Forbidden - Developer mode not enabled or insufficient permissions · 404 Log file not found · 500 Internal server error - Failed to fetch logs
POST/api/admin/log-viewer/clear
Clear log file Clear the contents of a specific log file. Requires ADMIN_ROOT permissions.
Request body: LogClear (application/json)
| Body field | Type | Required | Description |
|---|---|---|---|
type | string | yes | Log type to clear |
Response data field | Type | Description |
|---|---|---|
message | string | Success message |
curl -X POST "$PANEL_URL/api/admin/log-viewer/clear" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"type":""}'Plugin events: featherpanel:admin:log_viewer:cleared
Responses: 200 Log file cleared successfully · 401 Unauthorized · 403 Forbidden - Developer mode not enabled or insufficient permissions · 404 Log file not found · 500 Internal server error - Failed to clear logs
GET/api/admin/log-viewer/files
Get log files list Retrieve a list of all available log files with metadata. Only available in developer mode and requires ADMIN_ROOT permissions.
Response data field | Type | Description |
|---|---|---|
files | LogFile[] |
curl -X GET "$PANEL_URL/api/admin/log-viewer/files" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json"Responses: 200 Log files retrieved successfully · 401 Unauthorized · 403 Forbidden - Developer mode not enabled or insufficient permissions · 500 Internal server error - Failed to fetch log files
POST/api/admin/log-viewer/upload
Upload logs to MythicalSystems Paste Upload recent web and app logs to pastes.mythicalsystems.org and get shareable URLs. Requires ADMIN_ROOT permissions.
Response data field | Type | Description |
|---|---|---|
web | object | |
app | object | |
runner | object |
curl -X POST "$PANEL_URL/api/admin/log-viewer/upload" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json"Plugin events: featherpanel:admin:log_viewer:uploaded
Responses: 200 Logs uploaded successfully · 401 Unauthorized · 403 Forbidden - Developer mode not enabled or insufficient permissions · 500 Internal server error - Failed to upload logs