对于 AI 代理:可在 https://www.mongodb.com/zh-cn/docs/llms.txt 获取文档索引—通过在任何 URL 路径后添加 .md 可获取所有页面的 Markdown 版本。
Docs 菜单

查看和下载 MongoDB 日志

重要

The feature described on this page is not currently supported on Atlas Infinite clusters during public preview. For the features supported in public preview, see Public Preview Availability.

Each mongod and mongos instance keeps an account of its activity in its own log file. Atlas retains the last 30 days of log messages and system event audit messages. The Performance Advisor retains at most 7 days of logs. If you terminate a cluster, the logs that cluster generated persist, and you can download these logs at any point until the end of their retention periods if you have the Project Cluster Log Viewer access.

注意

注意

免费集群(以前称为 M0)和 Flex集群不提供可下载的日志。

To learn about recommendations for auditing and logging, including the events that we recommend auditing, see Guidance for Atlas Auditing and Logging in the Atlas Architecture Center.

要下载数据库访问权限日志,您必须至少拥有Project Database Access Admin 访问权限。

要下载日志,您必须对项目拥有 Project Data Access Read Only 或更高访问权限。拥有 Organization Owner 访问权限的用户须将自身作为 Project Owner 添加到此项目中。

如需使用 Atlas CLI 下载包含所选主机名日志的压缩文件, 请运行以下命令:

atlas logs download <hostname> <mongodb.gz|mongos.gz|mongosqld.gz|mongodb-audit-log.gz|mongos-audit-log.gz> [options]

要了解有关命令语法和参数的更多信息,请参阅 Atlas CLI 文档中的 atlas logs download。

有关读取 MongoDB 日志的信息,请参阅 MongoDB 手册中的日志消息文档。

要使用 Atlas CLI 查看部署日志,请运行以下命令:

atlas deployments logs [options]

如需进一步了解命令语法和参数,请参阅 Atlas CLI 文档中的 Atlas 部署日志。

注意

此功能适用于 M10 集群或更高版本。要进一步学习;了解哪些功能可用于免费集群,请参阅Atlas免费集群限制;有关 Flex 集群,请参阅Atlas Flex 限制。

您可以查看针对集群进行的身份验证尝试。成功和不成功的尝试都会被记录下来,包括尝试的时间戳以及对应用户。