[SERVER-8909] MongoDB- Customzieable log size and growth strategy Created: 08/Mar/13  Updated: 10/Dec/14  Resolved: 01/Apr/13

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Question Priority: Major - P3
Reporter: jameszhou Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to DOCS-1315 Document log rotation strategies Closed
Participants:

 Comments   
Comment by jameszhou [ 11/Jul/13 ]

Thanks all guys for your greate suggestions

Comment by Stennie Steneker (Inactive) [ 01/Apr/13 ]

Hi,

Some additional options to consider if you are on a Linux system:

  • use the logrotate daemon in conjuction with MongoDB's logRotate command
  • for MongoDB 2.2 or newer, you can use --syslog to redirect output to the syslog daemon (most modern syslogd's will support log rotation recipes, or you can use with logrotate)

Cheers,
Stephen

Comment by hari.khalsa@10gen.com [ 08/Mar/13 ]

Hi! You can limit the size of the oplog with --oplogSize:
http://docs.mongodb.org/manual/reference/mongod/#cmdoption-mongod--oplogSize

You can also specify --quiet to limit the amount of logging.

To specify where you want the log files, use --logpath:
http://docs.mongodb.org/manual/reference/mongod/#cmdoption-mongod--logpath

There is a logRotate command that may do what you want:
http://docs.mongodb.org/manual/reference/command/logRotate/

Comment by jameszhou [ 08/Mar/13 ]

I have been running MongoDB for some time. There brings about a issue deserved to be paid.

My customzie log strategy like below: 1) Limit a maximum size of 50MB for each log file 2) Limit a total of 7 log files under the specified log path

How can I implement such things in MongoDB?

Thanks In Advance!

Generated at Thu Feb 08 03:18:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.