发布于 2015-09-14 14:59:38 | 174 次阅读 | 评论: 0 | 来源: 网络整理
The getLog command returns a document with a log array that contains recent messages from the mongod process log. The getLog command has the following syntax:
{ getLog: <log> }
Replace <log> with one of the following values:
You may also specify an asterisk (e.g. *) as the <log> value to return a list of available log filters. The following interaction from the mongo shell connected to a replica set:
db.adminCommand({getLog: "*" })
{ "names" : [ "global", "rs", "startupWarnings" ], "ok" : 1 }
getLog returns events from a RAM cache of the mongod events and does not read log data from the log file.