Retrieve Compass Logs检索Compass日志
On this page本页内容
As part of normal operation, MongoDB Compass maintains a running log of events. 作为正常操作的一部分,MongoDB Compass维护事件的运行日志。Compass logs provide a history of operations and can help diagnose errors.Compass日志提供操作历史记录,有助于诊断错误。
MongoDB Compass redacts credentials from the logs.MongoDB Compass会对日志中的凭据进行编辑。
View Compass Logs查看Compass日志
Compass Log LocationCompass日志位置
Compass maintains one log file per session, compressed into a gzip archive file. Compass为每个会话维护一个日志文件,压缩为gzip归档文件。The corresponding session ID is included in the log file name.相应的会话ID包含在日志文件名中。
The directory where Compass writes logs depends on your operating system.Compass写入日志的目录取决于您的操作系统。
macOS | ~/.mongodb/compass/<LogID>_log.gz |
---|---|
Linux | ~/.mongodb/compass/<LogID>_log.gz |
Windows | %UserProfile%/AppData/Local/mongodb/compass/<LogID>_log.gz |
Log File Format日志文件格式
Compass outputs log messages in structured JSON format. Compass以结构化JSON格式输出日志消息。The messages are written in the same format used for MongoDB server logs.这些消息是用与MongoDB服务器日志相同的格式编写的。
See also:
To learn more about MongoDB logs and see examples, see Log Messages.要了解有关MongoDB日志的更多信息并查看示例,请参阅日志消息。
Log Retention日志保留
Compass retains log files for 30 days. Compass将日志文件保留30天。Log files older than 30 days are automatically deleted.超过30天的日志文件将自动删除。