Logs API
The Logs API allows you to retrieve logs from your app environments in Quave Cloud.
Make sure to read the Get Started document to understand how the API works.
Note: This API endpoint accepts only user tokens (not environment tokens).
Get Logs
To retrieve logs for an app environment, send a GET request to the /api/public/v1/logs endpoint.
You need to provide either appEnvId or envName to identify the environment.
Required Parameters (Either/Or)
You must provide either appEnvId or envName:
| Parameter | Type | Description |
|---|---|---|
appEnvId | String | The ID of the app environment to retrieve logs from. |
envName | String | The CLI environment name (alternative to appEnvId). |
Optional Parameters
| Parameter | Type | Description |
|---|---|---|
contentId | String | Content ID to filter logs. |
type | String | Log type to filter. See Available Log Types below. |
stream | String | Log stream to filter. stdout for standard output (info logs), stderr for error output. |
containerName | String | Container/pod name to filter logs (e.g., "my-app-web-5f8a9b"). |
search | String | Search query to filter log messages. Supports quoted phrases for exact matches. Case-insensitive. |
size | Number | Number of log entries to return. Default: 300. Maximum: 1000. |
from | String | Start timestamp for log retrieval (ISO 8601 format, e.g., "2024-01-15T10:00:00.000Z"). |
to | String | End timestamp for log retrieval (ISO 8601 format, e.g., "2024-01-15T11:00:00.000Z"). |
isLive | Boolean | Whether to retrieve recent live logs (ignores from/to). Default: false. |
scrollId | String | Scroll ID for pagination (obtained from previous response). |
callScroll | Boolean | Whether to use scroll pagination. Default: false. |
newScroll | Boolean | Whether to create a new scroll context. Default: false. |
Available Log Types
The type parameter accepts the following values:
| Type | Description |
|---|---|
WEB_APP | Application logs from your web containers. Main application output, server logs, and application errors. |
DATABASE | Database logs from MongoDB, PostgreSQL, MySQL, or other database containers. |
BUILD | Build and deployment logs. Shows the build process, image creation, and deployment steps. |
CHECKS | Health check logs. Includes readiness and liveness probe results. |
AUTO_SCALING | Autoscaling event logs. Shows when containers are scaled up or down. |
ACCESS_LOG | HTTP access logs from nginx/ingress. Shows incoming HTTP requests, response codes, and access patterns. |
WAF | Web Application Firewall logs. Shows blocked requests and security events. |
Available Stream Types
The stream parameter accepts:
stdout- Standard output stream. Contains informational messages, normal application output, and non-error logs.stderr- Error output stream. Contains error messages, warnings, and diagnostic information. Logs from this stream are typically marked withisError: true.
Response Structure
The response is a JSON object with the following fields:
| Field | Type | Description |
|---|---|---|
logs | Array | Array of log entries (see Log Entry Fields below). |
scrollId | String | Scroll ID for pagination. Null if scrolling is not enabled. |
Log Entry Fields
Each log entry in the logs array contains:
| Field | Type | Description |
|---|---|---|
_id | String | Unique identifier for the log entry. |
message | String | The log message content. |
time | Date | Timestamp when the log was generated. |
isError | Boolean | Whether this log entry is an error. |
podNameFinalPart | String | Final part of the pod name. |
Example: Basic Log Retrieval (with appEnvId)
curl -X GET \
-H 'Authorization: YOUR_TOKEN' \
'https://api.quave.cloud/api/public/v1/logs?appEnvId=5f7b1b7b7b7b7b7b7b7b7b7b'
Example: Basic Log Retrieval (with envName)
curl -X GET \
-H 'Authorization: YOUR_TOKEN' \
'https://api.quave.cloud/api/public/v1/logs?envName=production'
Example Response:
{
"logs": [
{
"_id": "abc123",
"podNameFinalPart": "web-5f8a9b",
"message": "Server started on port 3000",
"time": "2024-01-15T10:30:00.000Z",
"isError": false
},
{
"_id": "def456",
"podNameFinalPart": "web-5f8a9b",
"message": "Error: Connection timeout",
"time": "2024-01-15T10:31:00.000Z",
"isError": true
}
],
"scrollId": "DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ=="
}
Example: Search for Specific Text
curl -X GET \
-H 'Authorization: YOUR_TOKEN' \
'https://api.quave.cloud/api/public/v1/logs?appEnvId=5f7b1b7b7b7b7b7b7b7b7b7b&search=error&size=100'
Example: Filter by Time Range
curl -X GET \
-H 'Authorization: YOUR_TOKEN' \
'https://api.quave.cloud/api/public/v1/logs?appEnvId=5f7b1b7b7b7b7b7b7b7b7b7b&from=2024-01-15T10:00:00.000Z&to=2024-01-15T11:00:00.000Z'
Example: Pagination with Scroll
To retrieve more logs using pagination:
- First request with
newScroll=true:
curl -X GET \
-H 'Authorization: YOUR_TOKEN' \
'https://api.quave.cloud/api/public/v1/logs?appEnvId=5f7b1b7b7b7b7b7b7b7b7b7b&newScroll=true&size=300'
- Subsequent requests with
callScroll=trueand thescrollIdfrom the previous response:
curl -X GET \
-H 'Authorization: YOUR_TOKEN' \
'https://api.quave.cloud/api/public/v1/logs?appEnvId=5f7b1b7b7b7b7b7b7b7b7b7b&callScroll=true&scrollId=DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ=='
Example: Filter by Stream Type
To retrieve only error logs (stderr):
curl -X GET \
-H 'Authorization: YOUR_TOKEN' \
'https://api.quave.cloud/api/public/v1/logs?appEnvId=5f7b1b7b7b7b7b7b7b7b7b7b&stream=stderr'
Example: Filter by Log Type
To retrieve only application logs:
curl -X GET \
-H 'Authorization: YOUR_TOKEN' \
'https://api.quave.cloud/api/public/v1/logs?appEnvId=5f7b1b7b7b7b7b7b7b7b7b7b&type=WEB_APP'
To retrieve only build and deployment logs:
curl -X GET \
-H 'Authorization: YOUR_TOKEN' \
'https://api.quave.cloud/api/public/v1/logs?appEnvId=5f7b1b7b7b7b7b7b7b7b7b7b&type=BUILD'
To retrieve database logs:
curl -X GET \
-H 'Authorization: YOUR_TOKEN' \
'https://api.quave.cloud/api/public/v1/logs?appEnvId=5f7b1b7b7b7b7b7b7b7b7b7b&type=DATABASE'
Example: Combining Filters
Get application errors only (WEB_APP type + stderr stream):
curl -X GET \
-H 'Authorization: YOUR_TOKEN' \
'https://api.quave.cloud/api/public/v1/logs?appEnvId=5f7b1b7b7b7b7b7b7b7b7b7b&type=WEB_APP&stream=stderr'
Search for "timeout" in error logs with time range:
curl -X GET \
-H 'Authorization: YOUR_TOKEN' \
'https://api.quave.cloud/api/public/v1/logs?appEnvId=5f7b1b7b7b7b7b7b7b7b7b7b&stream=stderr&search=timeout&from=2024-01-15T10:00:00.000Z&to=2024-01-15T11:00:00.000Z'
Example: Get Live Logs
To retrieve the most recent logs (ignoring time range):
curl -X GET \
-H 'Authorization: YOUR_TOKEN' \
'https://api.quave.cloud/api/public/v1/logs?appEnvId=5f7b1b7b7b7b7b7b7b7b7b7b&isLive=true&size=100'
Example: Filter by Container Name
To get logs from a specific container:
curl -X GET \
-H 'Authorization: YOUR_TOKEN' \
'https://api.quave.cloud/api/public/v1/logs?appEnvId=5f7b1b7b7b7b7b7b7b7b7b7b&containerName=my-app-web-5f8a9b'
Notes
Environment Identification:
- You can use either
appEnvIdorenvNameto identify the environment. If both are provided,appEnvIdtakes precedence - When using
envName, the endpoint will look up the correspondingappEnvIdfrom your environments
Pagination:
- The
scrollIdis used for pagination and expires after 10 minutes of inactivity - Use
newScroll=truefor the first request to create a scroll context - Use
callScroll=truewith the returnedscrollIdfor subsequent pages - Maximum
sizeis 1000 logs per request. Default is 300
Filtering:
- All 7 log types are available:
WEB_APP,DATABASE,BUILD,CHECKS,AUTO_SCALING,ACCESS_LOG,WAF - Stream types:
stdout(info/normal output) andstderr(errors/warnings) - You can combine multiple filters (type, stream, search, time range, containerName) in a single request
- Search queries support both full-text search and exact phrase matching (use quotes for exact matches)
- Search is case-insensitive
Time Filtering:
- When
isLive=true, thefromandtoparameters are ignored and recent logs are returned - Time parameters must use ISO 8601 format (e.g., "2024-01-15T10:00:00.000Z")
Error Detection:
- The
isErrorfield automatically detects errors based on the stream type (stderr) and message content - Some informational messages from stderr (like npm warnings or docker pull messages) are not marked as errors
- Logs from
stderrstream are typically marked withisError: true
Error Responses
400- Invalid parameters, validation error, or missing bothappEnvIdandenvName401- User not authenticated403- User doesn't have permission to access this app environment404- App environment not found for the givenappEnvIdorenvName