Retrieve App Services logs

GET /groups/{groupId}/apps/{appId}/logs

Path parameters

Query parameters

  • co_id string

    Return only log messages associated with the given request Correlation ID.

  • errors_only boolean

    The value of this field does not matter. If included in the request, this endpoint only returns error logs (even if the value is set to false). If this field is excluded from the request, this endpoint only returns non-error logs.

  • user_id string

    Return only log messages associated with the given user_id.

  • start_date string

    The date and time in ISO 8601 at which to begin returning results, exclusive.

  • end_date string

    The date and time in ISO 8601 at which to cease returning results, inclusive.

  • skip integer

    The offset number of matching log entries to skip before including them in the response.

  • limit integer

    The maximum number of log entries to include in the response. If the query matches more than this many logs, it returns documents in ascending order by date until the limit is reached.

    Minimum value is 1, maximum value is 100.

  • type string

    The kind of log you would like to retrieve.

    Values are TRIGGER_FAILURE, TRIGGER_ERROR_HANDLER, DB_TRIGGER, AUTH_TRIGGER, SCHEDULED_TRIGGER, FUNCTION, SERVICE_FUNCTION, STREAM_FUNCTION, SERVICE_STREAM_FUNCTION, AUTH, WEBHOOK, ENDPOINT, PUSH, API, API_KEY, GRAPHQL, SYNC_CONNECTION_START, SYNC_CONNECTION_END, SYNC_SESSION_START, SYNC_SESSION_END, SYNC_CLIENT_WRITE, SYNC_ERROR, SYNC_OTHER, SCHEMA_ADDITIVE_CHANGE, SCHEMA_GENERATION, SCHEMA_VALIDATION, or LOG_FORWARDER.

Responses

  • 200 application/json

    Successfully retrieved.

    Hide response attributes Show response attributes object
    • logs array[object]

      At most 100 results per request.

      Not more than 100 elements.

      One of:
    • nextEndDate string Required

      The end date and time of the next page of log entries in ISO 8601 format. App Services paginates the result sets of queries that match more than 100 log entries and includes this field in paginated responses. To get the next page of up to 100 entries, pass this value as the end_date parameter in a subsequent request.

    • nextSkip integer Required

      The offset into the next page of log entries in ISO 8601 format. MongoDB App Services paginates the result sets of queries that match more than 100 log entries and includes this field in paginated responses where the first entry on the next page has the same timestamp as the last entry on this page. To get the next page of up to 100 entries, pass this value, if it is present, as the skip parameter in a subsequent request.

GET /groups/{groupId}/apps/{appId}/logs
curl \
 --request GET 'https://services.cloud.mongodb.com/api/admin/v3.0/groups/{groupId}/apps/{appId}/logs' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "logs": [
    {
      "_id": "63922bf071bdce7b19e14e76",
      "co_id": "63922bf071bdce7b19e14e75",
      "domain_id": "60c8f69884b0a73d14bb634b",
      "app_id": "60c8f69884b0a73d14bb634a",
      "group_id": "5b2ec426970199272441a214",
      "request_url": "/api/client/v2.0/app/test-for-now-vbwlr/auth/providers/anon-user/login",
      "request_method": "POST",
      "started": "2022-12-08T18:24:48.409Z",
      "completed": "2022-12-08T18:24:48.41Z",
      "type": "API"
    }
  ],
  "nextEndDate": "string",
  "nextSkip": 42
}