|
There is a strong expectation that logLevel 1 can be used to log all commands that are run, along with their parameters. However, this only happens once the command has finished (so that timing info can be included).
When the shutdown command succeeds, it does not finish (because the server exits), and so it isn't logged. This means that even at logLevel 1, it is impossible to know whether or not the shutdown was forced with force: true:
|
Loglevel 1
|
2015-06-15T20:36:29.735+1000 [conn1426] terminating, shutdown command received
|
2015-06-15T20:36:29.735+1000 [conn1426] dbexit: shutdown called
|
2015-06-15T20:36:29.735+1000 [conn1426] shutdown: going to close listening sockets...
|
...
|
2015-06-15T20:36:29.852+1000 [conn1426] dbexit: really exiting now
|
|
Loglevel 2
|
2015-06-15T20:38:36.862+1000 [conn2] run command admin.$cmd { shutdown: 1.0, force: true }
|
2015-06-15T20:38:36.862+1000 [conn2] command: { shutdown: 1.0, force: true }
|
2015-06-15T20:38:36.862+1000 [conn2] terminating, shutdown command received
|
2015-06-15T20:38:36.862+1000 [conn2] dbexit: shutdown called
|
2015-06-15T20:38:36.862+1000 [conn2] shutdown: going to close listening sockets...
|
...
|
2015-06-15T20:38:36.942+1000 [conn2] dbexit: really exiting now
|
Suggested change is:
-2015-06-15T20:36:29.735+1000 [conn1426] terminating, shutdown command received
|
+2015-06-15T20:36:29.735+1000 [conn1426] terminating, shutdown command received { shutdown: 1.0, force: true }
|
2015-06-15T20:36:29.735+1000 [conn1426] dbexit: shutdown called
|
2015-06-15T20:36:29.735+1000 [conn1426] shutdown: going to close listening sockets...
|
...
|
2015-06-15T20:36:29.852+1000 [conn1426] dbexit: really exiting now
|
i.e. log the shutdown cmdObj at all logLevels.
Should be straightforward to pass the cmdObj to shutdownHelper() (maybe optionally), since it's only called from the mongod and mongos shutdown command implementations, i.e. CmdShutdownMongoD and ClusterShutdownCmd, both of which have the cmdObj object available.
|