As part of normal operation, MongoDB Compass maintains a running log of events. Compass logs provide a history of operations and can help diagnose errors.作为正常操作的一部分,MongoDB Compass会维护一个事件的运行日志。Compass日志提供操作历史,可以帮助诊断错误。
Note
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. The corresponding session ID is included in the log file name.Compass为每个会话维护一个日志文件,压缩为gzip存档文件。相应的会话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. The messages are written in the same format used for MongoDB server logs.Compass以结构化JSON格式输出日志消息。这些消息以与MongoDB服务器日志相同的格式编写。
Tip
To learn more about MongoDB logs and see examples, see Log Messages.要了解有关MongoDB日志的更多信息并查看示例,请参阅日志消息。
Log Retention日志保留
Compass retains log files for 30 days. Log files older than 30 days are automatically deleted.Compass保留日志文件30天。超过30天的日志文件将自动删除。