Skip to content

Why can't I see the logs for my Amazon DocumentDB cluster?

3 minute read
1

I want to review the logs for my Amazon DocumentDB (with MongoDB compatibility) instance, but I don’t see the logs in Amazon CloudWatch.

Resolution

Issues with audit logs

You might experience one of the following issues with audit logs:

  • You can't see your DML logs in the CloudWatch directory after you turn on the audit_log parameter and set the value to enabled. The legacy setting for DDL logs is enabled. To view the DML logs, you must include dml_read or dml_write in the audit_log parameter value.
  • You can't see the entire query in the CloudWatch DML audit log message. This issue occurs because values in the DML event document parameter field have a 1 KB size limit. Amazon DocumentDB reduces any values that exceed 1 KB.
  • You can't see a command in the CloudWatch DML audit log message. When a DML command reaches the Amazon DocumentDB instance, it goes through multiple steps for audit logging. If it fails in the parsing step (syntax analysis) because of a syntax error, then the command doesn't appear in the DML audit log. If the command fails in the execution step, then it's logged.

Issues with profiler logs

You might experience one of the following issues with profiler logs:

  • Your queries don't reach the threshold that's defined in the parameter group. To resolve this issue, set the profiler_threshold_ms based on your requirements. 50 milliseconds is the lowest threshold that you can set.
  • Amazon DocumentDB profiler doesn't support your operation. Profiling supports only specific operations. Make sure that the queries you use are supported.
  • The profiler logs aren't active. Simulate a long query in a sample data set to check whether the profiler logs activate and work as expected. If they activate correctly, then you can see profiler logs in the log group as /aws/docdb/profiler.

Best practices

When you turn on logging for your Amazon DocumentDB cluster, take the following actions:

Note: The log group doesn't appear until the first log group record occurs.

Related information

Profiling Amazon DocumentDB operations

Auditing Amazon DocumentDB events

Profiling slow-running queries in Amazon DocumentDB (with MongoDB compatibility)

AWS OFFICIALUpdated 3 months ago