View .md

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

Auth: AdminPermission: admin.rootRoute name: admin-log-viewer-getController: LogViewerController::getLogsroute source

Get log content Retrieve the last N lines from a specific log file. Only available in developer mode and requires ADMIN_ROOT permissions.

ParameterInTypeRequiredDescription
typequerystringnoLog type to retrieve
linesqueryintegernoNumber of lines to retrieve from the end of the log file

Response data: LogContent

Response data fieldTypeDescription
logsstringLog content as string
filestringLog file name
typestringLog type
lines_countintegerNumber 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

Auth: AdminPermission: admin.rootRoute name: admin-log-viewer-clearController: LogViewerController::clearLogsroute source

Clear log file Clear the contents of a specific log file. Requires ADMIN_ROOT permissions.

Request body: LogClear (application/json)

Body fieldTypeRequiredDescription
typestringyesLog type to clear
Response data fieldTypeDescription
messagestringSuccess 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

Auth: AdminPermission: admin.rootRoute name: admin-log-viewer-filesController: LogViewerController::getLogFilesroute source

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 fieldTypeDescription
filesLogFile[]
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

Auth: AdminPermission: admin.rootRoute name: admin-log-viewer-uploadController: LogViewerController::uploadLogsroute source

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 fieldTypeDescription
webobject
appobject
runnerobject
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