Skip to main content

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:

ParameterTypeDescription
appEnvIdStringThe ID of the app environment to retrieve logs from.
envNameStringThe CLI environment name (alternative to appEnvId).

Optional Parameters

ParameterTypeDescription
contentIdStringContent ID to filter logs.
typeStringLog type to filter. See Available Log Types below.
streamStringLog stream to filter. stdout for standard output (info logs), stderr for error output.
containerNameStringContainer/pod name to filter logs (e.g., "my-app-web-5f8a9b").
searchStringSearch query to filter log messages. Supports quoted phrases for exact matches. Case-insensitive.
sizeNumberNumber of log entries to return. Default: 300. Maximum: 1000.
fromStringStart timestamp for log retrieval (ISO 8601 format, e.g., "2024-01-15T10:00:00.000Z").
toStringEnd timestamp for log retrieval (ISO 8601 format, e.g., "2024-01-15T11:00:00.000Z").
isLiveBooleanWhether to retrieve recent live logs (ignores from/to). Default: false.
scrollIdStringScroll ID for pagination (obtained from previous response).
callScrollBooleanWhether to use scroll pagination. Default: false.
newScrollBooleanWhether to create a new scroll context. Default: false.

Available Log Types

The type parameter accepts the following values:

TypeDescription
WEB_APPApplication logs from your web containers. Main application output, server logs, and application errors.
DATABASEDatabase logs from MongoDB, PostgreSQL, MySQL, or other database containers.
BUILDBuild and deployment logs. Shows the build process, image creation, and deployment steps.
CHECKSHealth check logs. Includes readiness and liveness probe results.
AUTO_SCALINGAutoscaling event logs. Shows when containers are scaled up or down.
ACCESS_LOGHTTP access logs from nginx/ingress. Shows incoming HTTP requests, response codes, and access patterns.
WAFWeb 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 with isError: true.

Response Structure

The response is a JSON object with the following fields:

FieldTypeDescription
logsArrayArray of log entries (see Log Entry Fields below).
scrollIdStringScroll ID for pagination. Null if scrolling is not enabled.

Log Entry Fields

Each log entry in the logs array contains:

FieldTypeDescription
_idStringUnique identifier for the log entry.
messageStringThe log message content.
timeDateTimestamp when the log was generated.
isErrorBooleanWhether this log entry is an error.
podNameFinalPartStringFinal 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:

  1. 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'
  1. Subsequent requests with callScroll=true and the scrollId from 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 appEnvId or envName to identify the environment. If both are provided, appEnvId takes precedence
  • When using envName, the endpoint will look up the corresponding appEnvId from your environments

Pagination:

  • The scrollId is used for pagination and expires after 10 minutes of inactivity
  • Use newScroll=true for the first request to create a scroll context
  • Use callScroll=true with the returned scrollId for subsequent pages
  • Maximum size is 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) and stderr (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, the from and to parameters 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 isError field 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 stderr stream are typically marked with isError: true

Error Responses

  • 400 - Invalid parameters, validation error, or missing both appEnvId and envName
  • 401 - User not authenticated
  • 403 - User doesn't have permission to access this app environment
  • 404 - App environment not found for the given appEnvId or envName