Skip to main content

Logger - Collection Info Read

Endpoint

/o?method=collection_info

Overview

Returns storage info for the app-specific logger collection: configured cap, current document count, and max value used by logger.

Authentication

Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.

Permissions

Requires logger Read permission.

Request Parameters

ParameterTypeRequiredDescription
methodStringYesMust be collection_info.
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.
app_idStringConditionalRequired for non-global-admin users during read validation.

Examples

Read logger collection usage

/o?
method=collection_info&
api_key=YOUR_API_KEY&
app_id=6991c75b024cb89cdc04efd2

Response

Success Response

Standard path:

{
"capped": 1000,
"count": 126,
"max": 1000
}

Fallback path (when count query fails):

{
"capped": 1000,
"count": 1000,
"max": 1000,
"status": "error"
}

Response Fields

FieldTypeDescription
cappedNumberLogger cap value used by the endpoint.
countNumberCurrent document count in logs{appId} (or fallback cap value on error).
maxNumberSame cap value returned for compatibility.
statusStringPresent only in fallback response; value is "error".

Error Responses

  • 400
{
"result": "Missing parameter \"api_key\" or \"auth_token\""
}
  • 400
{
"result": "Token not valid"
}
  • 401
{
"result": "No app_id provided"
}
  • 401
{
"result": "User does not exist"
}
  • 401
{
"result": "App does not exist"
}
  • 401
{
"result": "User does not have right"
}
  • 401
{
"result": "User is locked"
}
  • 401
{
"result": "Token is invalid"
}

Behavior

Behavior Modes

ModeTriggerProcessing PathResponse Shape
Stats success$collStats aggregation succeedsReads storageStats.count from logs{appId} and returns cap/count/max values.Raw object: { "capped": 1000, "count": N, "max": 1000 }
Stats fallback$collStats aggregation throwsReturns fallback object with cap values and status: "error".Raw object: { "capped": 1000, "count": 1000, "max": 1000, "status": "error" }

Impact on Other Data

  • Read-only endpoint. It does not modify any collections.

Operational Considerations

  • This endpoint uses a live $collStats query on the app log collection.
  • If stats lookup fails, response still returns 200 with status: "error" and fallback numeric values.

Limitations

  • capped/max values come from server constant (1000) used by this endpoint.
  • Fallback values are not real counts and should not be used for storage planning.
Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
countly.membersAuthentication and permission checksReads member account, lock state, and feature-level app permissions.
countly.appsApp validation/context loadingValidates app_id and loads app context for access checks.
countly.logs{appId}Collection usage metricsCounts documents in the app-specific request-log collection.