我这个MongoDB的日志怎么感觉不太对?
刚刚学习安装了MongoDB,版本4.4.0 ;然后成功启动后访问
http://localhost:27017/ 显示
It looks like you are trying to access MongoDB over HTTP on the native driver port.
控制台的日志怎么感觉不太对啊? 我看别人的日志不是这样的,我这个怎么是json格式的字符串?
{"t":{"$date":"2020-08-20T19:58:00.210+08:00"},"s":"W", "c":"CONTROL", "id":20698, "ctx":"main","msg":"***** SERVER RESTARTED *****","tags":["startupWarnings"]}
{"t":{"$date":"2020-08-20T19:58:00.212+08:00"},"s":"I", "c":"CONTROL", "id":23285, "ctx":"main","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
{"t":{"$date":"2020-08-20T20:31:27.953+08:00"},"s":"I", "c":"CONTROL", "id":23138, "ctx":"consoleTerminate","msg":"Shutting down","attr":{"exitCode":12}}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
真的是版本问题,4.4.0日志格式都变了,下个了mongodb-4.0.19 试了一下,果然是,这是4.0.19的日志。。 太坑了
补充:
看了4.4.0 的版本说明,新出了个结构化日志
详解见官网说明
Structured Logging
Starting in MongoDB 4.4, mongod / mongos instances now output all log messages in structured JSON format. This includes log output sent to the file, syslog, and stdout (standard out) log destinations, as well as the output of the getLog command.
Previously, log entries were output as plaintext.
If you have existing log parsing utilities, or use a log ingestion service, you may need to reconfigure these tools for the new structured logging format with MongoDB 4.4.
See Log Messages for a detailed examination of the new structured logging format, including examples of log parsing using the new log structure.
你用 http 的方式访问了 mongodb 的服务端口?
你为什么不用 mongo 命令行访问呢?
你想访问 mongodb 的 rest 接口吧?
默认是 http://127.0.0.1:28017 吧