Overview
The Log API is an API for referencing and downloading the log files of Fess. It allows you to retrieve a list of log files output on the server and download individual log files.
Base URL
Authentication
As with other Admin APIs, authentication using an access token is required. The access token must have the Radmin-api permission (configured via api.admin.access.permissions; the default value is Radmin-api). Specify the access token in the request header.
For details on authentication and how to obtain an access token, see Admin API Overview.
Endpoint List
| Method | Path | Description |
|---|---|---|
| GET | /files | Retrieve log file list |
| GET | /file/{id} | Download log file |
Retrieve Log File List
Returns a list of log files (.log and .log.gz) that exist in the server’s log output directory. The files are returned sorted in ascending order by file name.
Request
Response
files contains an array of objects representing the information of each log file, and total contains the count. Each object has the following fields.
| Field | Description |
|---|---|
id | The file name encoded with Base64 URL encoding (used for {id} when downloading) |
name | Log file name |
lastModified | Last modified date and time |
Note
version is set to the product version of the running Fess. The contents and count of files vary depending on the log files on the server, so the above is just an example.
Download Log File
Downloads the contents of the specified log file. For {id}, specify the id (the file name encoded with Base64 URL encoding) returned by the file list retrieval as-is. The response is returned as an application/octet-stream stream. For security, only names ending with .log or .log.gz are accepted, and names containing path manipulation sequences such as .. are rejected. If you specify a non-existent file name or a name that is not permitted as a log file, an empty response is returned.
Request
Response
A binary stream of the log file (Content-Type: application/octet-stream).
Usage Examples
Retrieve Log File List
Download Log File
Reference
Admin API Overview - Admin API Overview
Backup API - Backup API