Docs Menu

Docs HomeAtlas App Services

Application Logs

On this page

  • Introduction
  • Concepts
  • Log Entry
  • Parts of a Log Entry
  • Log Filters
  • Error Logs
  • Constraints
  • Log Lines
  • Log Retention

Atlas App Services logs all incoming requests and application events such as user authentication, trigger execution, and service interactions. You can access your application's logs from the Logs page in the App Services UI or request them programmatically through the App Services Admin API. App Services saves logs for 10 days.

A log entry describes a single event within App Services. Different events in App Services execute in different ways, requiring various permissions, underlying components and services. App Services groups log entries based on the type of event or request that they record. Each type of log contains fields that describe that particular event or request. As a result, your application logs may include entries of the following types:

  • Authentication Requests, including user creation, login, and deletion.

  • Change Stream, including any time a user opens or closes a stream of change events.

  • Endpoint requests, including any time a request is made to a Data API endpoint.

  • Functions, 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.

  • Triggers, including Database Triggers, Authentication Triggers, and Scheduled Triggers.

  • Service Requests, including HTTPS endpoints and service action calls issued from the a Realm SDK.

  • Schema changes, including any events related to changes to an application's schema.

  • Sync events, including all events related to data synchronization between client devices and MongoDB Atlas.

App Services logs contain details like the status, timestamp, elapsed time, unique id, user, name, and type of a given log entry.
Request Info
Log entries can contain several types of request details, including event arguments, service name, function call location, compute resources used, remote IP address, SDK, platform version, and performance metrics. Requesting log entries via the App Services Admin API will expose these as top-level fields in log entry objects. On the App Services UI, clicking on a log entry will expose this information.
App Services logs the arguments passed to Functions, including requests made via the MongoDB service. Other log entries do not preserve a record of arguments.
Error Info
When an App Services event exits unsuccessfully, it generates an Error log entry containing debugging information that can help diagnose what caused the issue.

Because App Services creates log entries for most common kinds of user interaction, it can become difficult to find a specific group of logs due to the sheer volume of logs an application generates. 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.

All App Services log entries have one of two possible statuses: OK and Error. If an event exits successfully, App Services generates an OK log entry based on the event. If an event does not exit successfully for any reason, App Services creates a log entry with a status of the App Services error that caused the problem. You may encounter errors if you:

  • Attempt to access data from MongoDB Atlas for which there is no applicable rule

  • Fail to catch an exception or promise rejection in an Atlas Function

  • Call for a service which does not exist

  • Call a MongoDB Atlas service action with invalid or missing parameters

Functions can log information using JavaScript's console.log() 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 counts.

App Services saves only the first 25 log lines for a given log entry.

App Services stores each output as a single string in the log entry's Logs field.

App Services retains logs for 10 days, after which they are deleted.

If you require logs older than 10 days, you can set up a log forwarder or use the admin log API prior to the expiration date of each log to extract and externally store your log history.

←  Access a ValueView Logs in the App Services UI →
Share Feedback
© 2022 MongoDB, Inc.


  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2022 MongoDB, Inc.