Docs Menu

Application Logs

On this page

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

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 Atlas App Services UI or request them programmatically through the App Services Admin API. Atlas App Services saves logs for 10 days.

A log entry describes a single event within Atlas App Services. Different events in Atlas App Services execute in different ways, requiring various permissions, underlying components and services. Atlas 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.
  • Functions, including both App Services 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.
  • Change Stream, including any time a user opens or closes a stream of change events.
  • 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.
Section
Description
Metadata
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 Atlas App Services UI, clicking on a log entry will expose this information.
Arguments
Atlas 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 Atlas App Services event exits unsuccessfully, it generates an Error log entry containing debugging information that can help diagnose what caused the issue.

Because Atlas 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, Atlas 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 Atlas App Services log entries have one of two possible statuses: OK and Error. If an event exits successfully, Atlas App Services generates an OK log entry based on the event. If an event does not exit successfully for any reason, Atlas App Services creates a log entry with a status of the Atlas 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 App Services Function
  • Call context.services.get() 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. Atlas App Services stringifies each console log and stores each string as a single line. Atlas 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.

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

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

Atlas 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.

Subject
Description
This page describes the form and content of authentication logs as well as the events that lead to their creation.
This page describes the form and content of change stream logs as well as the events that lead to their creation.
This page describes the form and content of function logs as well as the events that lead to their creation.
This page describes the form and content of trigger logs as well as the events that lead to their creation.
This page describes the form and content of schema logs as well as the events that lead to their creation.
This page describes the form and content of sync logs as well as the events that lead to their creation.
←  Access a ValueView Logs in the Atlas App Services UI →
Give Feedback
© 2022 MongoDB, Inc.

About

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