发布于 2015-09-14 14:57:54 | 153 次阅读 | 评论: 0 | 来源: 网络整理

logRotate

The logRotate command is an administrative command that allows you to rotate the MongoDB logs to prevent a single logfile from consuming too much disk space. You must issue the logRotate command against the admin database in the form:

{ logRotate: 1 }

注解

Your mongod instance needs to be running with the --logpath [file] option.

You may also rotate the logs by sending a SIGUSR1 signal to the mongod process. If your mongod has a process ID of 2200, here’s how to send the signal on Linux:

kill -SIGUSR1 2200

logRotate renames the existing log file by appending the current timestamp to the filename. The appended timestamp has the following form:

<YYYY>-<mm>-<DD>T<HH>-<MM>-<SS>

Then logRotate creates a new log file with the same name as originally specified by the logpath setting to mongod or mongos.

注解

2.0.3 新版功能: The logRotate command is available to mongod instances running on Windows systems with MongoDB release 2.0.3 and higher.

最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务