For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.
Docs Menu

Export Logs to External Services

You can configure your M10+ Atlas clusters to export system logs every minute to an external service. Exporting logs to an external service enables centralized log management, long-term retention, and integration with your existing monitoring and observability tools.

Atlas supports exporting the following log types:

  • mongod logs

  • mongos logs

  • mongod-audit logs

  • mongos-audit logs

You can specify which log types you want to export and configure up to 10 export paths to send logs to multiple destinations simultaneously.

Important

Logs can contain sensitive information (including PII). You are responsible for the storage and treatment of your logs in your external service. To have Atlas redact certain information before exporting logs, contact MongoDB Support.

  • You must have an M10+ cluster to export logs. Log export is not available for free or shared-tier clusters.

  • You must have Project Owner or Organization Owner access to configure log export.

  • Each Atlas host typically produces 1 GB of logs per day. Exporting logs incurs a data transfer cost. The exact data transfer cost varies depending on the destination, region, and cloud provider.

  • Log egress originates from the Atlas control plane in AWS us-east-1, regardless of your cluster's region or cloud provider. If your cluster is not in AWS us-east-1, you incur cross-region or inter-cloud data transfer charges in addition to Internet egress costs. To learn more about data transfer costs, see Data Transfer Costs.

  • Network issues or retries can cause duplicate log entries in your external service.

Atlas automatically handles log export failures and recovers without manual intervention:

When log delivery to your external sink fails, Atlas automatically retries with exponential backoff for up to 3 attempts by default. The retry delay starts at 1 second and doubles up to a maximum of 10 seconds between attempts.

After 5 consecutive failures, a circuit breaker opens to prevent hammering your sink with repeated requests. The circuit breaker stays open for 5 minutes before it attempts a test write. If the test succeeds, normal operation resumes. If it fails, the circuit breaker reopens.

Each sink configuration has its own independent circuit breaker, so issues with one integration don't affect others.

When retries are exhausted or errors are non-retryable (such as invalid credentials), Atlas queues failed log events in a Dead Letter Queue (DLQ) with a 7-day retention. The DLQ prevents data loss while your sink is unavailable.

Warning

Logs older than 7 days are permanently deleted from the DLQ. If your sink remains inaccessible for more than 7 days, those logs cannot be recovered.

When connectivity is restored and the circuit breaker closes, Atlas automatically replays queued logs from the DLQ to your sink. No manual intervention is required.

Warning

If you modify the sink configuration while logs are queued in the DLQ, the queued logs will use the new configuration when replayed. For example, if you change the destination from one S3 bucket to another, queued logs will be sent to the new bucket rather than the original destination.

Atlas provides default alerts that automatically send email notifications to Project Owner users when:

  • Log export encounters non-retryable errors (logs queued in DLQ).

  • Log export fails after multiple retry attempts (logs queued in DLQ).

  • Log export replay fails to deliver records.

Additionally, the Project Activity Feed logs the following informational events:

  • Log export recovered (queued logs ready to resume).

  • Log export recovered (queued logs now being sent).

  • All queued logs delivered.

You can customize alert recipients and notification methods in your project's alert settings. For details, see Configure an Alert.

The following table summarizes the external services that Atlas supports for log export:

Destination
Description

Export mongod, mongos, and audit logs to an AWS S3 bucket. Supports Multi-Region Access Points (MRAPs).

Export mongod, mongos, and audit logs to an Azure Blob Storage container.

Export mongod, mongos, and audit logs to Datadog for real-time log analysis and dashboards.

Export mongod, mongos, and audit logs to a Google Cloud Storage bucket.

Export mongod, mongos, and audit logs to an OpenTelemetry (OTel) endpoint for vendor-neutral observability.

Export mongod, mongos, and audit logs to Splunk Cloud or Splunk Enterprise for centralized log search and analysis.