App Services keeps a log of application events, records metrics that summarize your App's usage and performance, and publishes notifications to your Atlas project's activity feed.
App Services logs all incoming requests and application events. These events include API requests, Device Sync operations, Trigger execution, User Authentication, and other activities. App Services saves logs for 10 days, after which they are deleted.
To learn how to view, filter, and analyze your application logs, see View Application Logs.
A log entry describes a single application event of a given type. Each entry contains information about the event and how the system responded. For example, a log may include the IP address that issued a request as well as a summary of the data access permissions that were evaluated and assigned to serve the request.
Apps log the following event types:
Authentication, including user creation, login, and deletion.
Change Stream, including any time a user opens or closes a stream of change events.
Device Sync, including all events related to data synchronization between client devices and MongoDB Atlas.
Endpoint, including any time a request is made to a Data API endpoint.
Function, including both Atlas Functions as well as individual queries to linked MongoDB Atlas data sources made using the MongoDB service of the a Realm SDK.
Service, including HTTPS endpoints and service action calls issued from the a Realm SDK.
Schema, including any events related to changes to an application's schema.
Trigger, including Database Triggers, Authentication Triggers, and Scheduled Triggers.
All App Services log entries have one of two possible statuses:
OK, which represents a normal event that succeeded without an error.
Error, which represents an event that did not run successfully for any reason.
For example, App Services would log an error for any of the following events:
You attempt to access data stored in Atlas for which there is no applicable rule.
You throw or fail to handle an error or promise rejection in an Atlas Function.
context.services.get()for a service which does not exist.
For performance reasons, App Services limits individual queries to a maximum of 100 log entries per page. You can filter entries by type, status, timestamp, user, and request ID to return only logs that are relevant to your query.
method. App Services stringifies each console log and stores each string
as a single line. App Services truncates lines to 512 bytes in length.
For ASCII character sets, this translates to 512 characters; depending
on the character set you use, you may see truncation at lower character
App Services saves only the first 25 log lines for a given log entry.
App Services retains logs for 10 days, after which they are deleted.
If you require logs older than 10 days, you can automatically forward logs to another service. You can also download a dump of currently available logs from the UI or use the Admin API Logging endpoints to fetch logs before they expire.
App Services constantly measures your App's usage and records aggregate metrics over time. You can access and use the metrics to assess your App's performance and see trends in how your App is used. For example, you can see how much time your App spent performing computations or find the 95th percentile response time for Data API requests.
To learn more about which metrics are available and how to access them, see App Services Metrics.
Your App publishes alert events to your Atlas project's activity feed. App Services alerts for administrative events, such as when someone deploys changes to an App or when something like a Trigger or Device Sync process fails and cannot restart automatically. To learn more about your App's alerts, see Activity Feed & Atlas App Services Alerts.