Error Logs - Logs Read
Endpoint
/o/errorlogs
Overview
Returns discovered Countly log file contents as a key-value map (log_key -> log_text).
Authentication
Countly API supports three authentication methods:
- API Key (parameter):
api_key=YOUR_API_KEY - Auth Token (parameter):
auth_token=YOUR_AUTH_TOKEN - Auth Token (header):
countly-token: YOUR_AUTH_TOKEN
Permissions
- Required permission: Global Admin.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | String | Yes (or use auth_token) | API key for authentication. |
auth_token | String | No | Auth token as query parameter or countly-token header. |
bytes | Number | No | If greater than 0, returns only the last N bytes (aligned to first full line in the read chunk) from each log. |
Response
Success Response
{
"api": "2026-02-17 10:00:00 [INFO] API started\n...",
"dashboard": "2026-02-17 10:00:01 [INFO] Dashboard started\n..."
}
Response Fields
| Field | Type | Description |
|---|---|---|
(root) | Object | Raw map of discovered log keys to log text content. |
{log_key} | String | Log content for that key (full or tail text based on bytes). |
Error Responses
400
{
"result": "Missing parameter \"api_key\" or \"auth_token\""
}
400
{
"result": "Token not valid"
}
401
{
"result": "User does not exist"
}
401
{
"result": "User does not have right"
}
401
{
"result": "User is locked"
}
401
{
"result": "Token is invalid"
}
Behavior/Processing
- Validates global-admin permissions.
- Discovers log files matching
countly-*.login server log directory. - Reads each log file (full content or tail bytes).
- Returns discovered logs as one object map.
- Read failures per file return empty string for that file key.
Database Collections
This endpoint does not read or write database collections.
Examples
Read all logs (full)
/o/errorlogs?api_key=YOUR_API_KEY
Read last 2000 bytes from each log
/o/errorlogs?api_key=YOUR_API_KEY&bytes=2000
Limitations
- Output size can be large when
bytesis omitted. - Individual file read failures do not fail the whole response; affected log values are empty strings.
Related Endpoints
Last Updated
2026-02-17