Specifying maximum size of the mongo log file

1,282 views
Skip to first unread message

prashant

unread,
Mar 21, 2011, 11:10:45 AM3/21/11
to mongodb-user
Hi,

Is there a way to specify the maximum size of the mongo log file?
Basically I want to be able to control the size after which log file
would be overwritten.

Also is there some configuration related to log file rotation which
handles log file rotation automatically or is "
db.runCommand("logRotate")" the only option?

Thanks!
Prashant

Andreas Jung

unread,
Mar 21, 2011, 11:14:10 AM3/21/11
to mongod...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Use the Unix "logrotate" command.

- -aj


- --
ZOPYX Limited | zopyx group
Charlottenstr. 37/1 | The full-service network for Zope & Plone
D-72070 T�bingen | Produce & Publish
www.zopyx.com | www.produce-and-publish.com
- ------------------------------------------------------------------------
E-Publishing, Python, Zope & Plone development, Consulting


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQGUBAEBAgAGBQJNh2tCAAoJEADcfz7u4AZjB6QLv1R4OvkImLTJjlP09VscEDjo
+AbV64/4/MIeWt0+QA06mQccrgfEjlRXbSWX8SnjWLMZwwXPth8Atuq8SJU2lXse
N/QGN4e1P67F2RRtUaE++gRNCh2+ZUo9QhJpOUYz4A2pBsVSt9tu2GHJGP2FcEAN
zb8eZXwP2ZMq/S89qTCU8MmKtgOEBcC8b8JzMkfutrC7pZ/WbtVYiWi1kGI0rL/k
yeLlaYm5dHUpJPLUC3eO2hM+YRjq2mNkKX8sfZxim2Q23weQ4BrNqyq54f7/gOTq
19KzW82UZaUCQTDRAdAfAQJqnrm6otfVAHAOtnFYsPAflV07uwCEOsn4+zWgKbgP
06gsMuI0mJEa96PtIpY6NwXYokg58qPiJJ9PmuR9INWpj+B9BKnbYQ++kySFPlmj
paWYF0ke5gti0U395CRC6u1cIa8DYqiOXikKEVb1rgYWFsE2SIMT4bO3xeLHhj1q
SX7zrrhLptddmsOdF/C+cuhn0M3ZF7k=
=uZJH
-----END PGP SIGNATURE-----

lists.vcf

prashant

unread,
Mar 21, 2011, 11:25:23 AM3/21/11
to mongodb-user
Thanks Andreas!

What is the criteria of overwriting the normal log file when we don't
use the "logappend" option?

Thanks!
Prashant

On Mar 21, 11:14 am, Andreas Jung <li...@zopyx.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Use the Unix "logrotate" command.
>
> - -aj
>
> prashant wrote:
> > Hi,
>
> > Is there a way to specify the maximum size of the mongo log file?
> > Basically I want to be able to control the size after which log file
> > would be overwritten.
>
> > Also is there some configuration related to log file rotation which
> > handles log file rotation automatically or is "
> > db.runCommand("logRotate")" the only option?
>
> > Thanks!
> > Prashant
>
> - --
> ZOPYX Limited           | zopyx group
> Charlottenstr. 37/1     | The full-service network for Zope & Plone
> D-72070 T�bingen        | Produce & Publishwww.zopyx.com          |www.produce-and-publish.com
> - ------------------------------------------------------------------------
> E-Publishing, Python, Zope & Plone development, Consulting
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (Darwin)
> Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/
>
> iQGUBAEBAgAGBQJNh2tCAAoJEADcfz7u4AZjB6QLv1R4OvkImLTJjlP09VscEDjo
> +AbV64/4/MIeWt0+QA06mQccrgfEjlRXbSWX8SnjWLMZwwXPth8Atuq8SJU2lXse
> N/QGN4e1P67F2RRtUaE++gRNCh2+ZUo9QhJpOUYz4A2pBsVSt9tu2GHJGP2FcEAN
> zb8eZXwP2ZMq/S89qTCU8MmKtgOEBcC8b8JzMkfutrC7pZ/WbtVYiWi1kGI0rL/k
> yeLlaYm5dHUpJPLUC3eO2hM+YRjq2mNkKX8sfZxim2Q23weQ4BrNqyq54f7/gOTq
> 19KzW82UZaUCQTDRAdAfAQJqnrm6otfVAHAOtnFYsPAflV07uwCEOsn4+zWgKbgP
> 06gsMuI0mJEa96PtIpY6NwXYokg58qPiJJ9PmuR9INWpj+B9BKnbYQ++kySFPlmj
> paWYF0ke5gti0U395CRC6u1cIa8DYqiOXikKEVb1rgYWFsE2SIMT4bO3xeLHhj1q
> SX7zrrhLptddmsOdF/C+cuhn0M3ZF7k=
> =uZJH
> -----END PGP SIGNATURE-----
>
>  lists.vcf
> < 1KViewDownload

Andreas Jung

unread,
Mar 21, 2011, 11:33:11 AM3/21/11
to mongod...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

No idea - check the logrotate man page - it offers various options.

- -aj

prashant wrote:
> Thanks Andreas!
>
> What is the criteria of overwriting the normal log file when we don't
> use the "logappend" option?
>
> Thanks!
> Prashant
>
> On Mar 21, 11:14 am, Andreas Jung <li...@zopyx.com> wrote:
> Use the Unix "logrotate" command.
>

> -aj
>
> prashant wrote:
>>>> Hi,
>>>> Is there a way to specify the maximum size of the mongo log file?
>>>> Basically I want to be able to control the size after which log file
>>>> would be overwritten.
>>>> Also is there some configuration related to log file rotation which
>>>> handles log file rotation automatically or is "
>>>> db.runCommand("logRotate")" the only option?
>>>> Thanks!
>>>> Prashant
>>

lists.vcf
< 1KViewDownload

- --
ZOPYX Limited | zopyx group
Charlottenstr. 37/1 | The full-service network for Zope & Plone

D-72070 T�bingen | Produce & Publish

www.zopyx.com | www.produce-and-publish.com


- ------------------------------------------------------------------------
E-Publishing, Python, Zope & Plone development, Consulting


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQGUBAEBAgAGBQJNh2+3AAoJEADcfz7u4AZjjWQLv24WPwpaYb2y8zdKM2EAJNfk
nH5aGXtT1WUrK5+cNb7vtBv4MlDjViYaGdKVMY/CofnNnP7XmiNg6+Yrk/VW2NVU
O6Dq1aA+F2IIow6MKNEdciuNb3+Hfpjl3euIlBs7DSS6CaHhuOaSJM1A9y3qGF4L
B0cuK9+/svLvfvmJb3nXOskY7exg2V2zFz1lyic3l23bBWeS92Q0OHfdhu2bdvat
XP7HvLxAQ1RP6J49jDmqperfCfwK3tSMuizJbVtiPtQPYiDSGsi0eOyK4goH/e0B
pF41XsYtAodsx/zbs4cNGvjwQKajvPb7rHlTF9ne0kMthGPyshyKlJr3s5y7gjKQ
GxGCRS/D9zvREJgA6hsG1crjYzpl368LEPk2EE4gESdXX+xtsTdvQdKTVdFCKlX6
xmlmFLmVd7Z2oqEGqJXTlvxu6yv18tMrFsR4CkLC2ThmlD2qvPVI4RJ750LSM6N+
JO0j6sfivWczxn8CsRbAn32kXCzf9/E=
=71Wi
-----END PGP SIGNATURE-----

lists.vcf

Scott Hernandez

unread,
Mar 21, 2011, 11:50:48 AM3/21/11
to mongod...@googlegroups.com
http://www.mongodb.org/display/DOCS/Logging has more info.

If you don't use --logappend then when you start mongod it will
over-write the log file. I will have to check on the behavior of no
--logappend and issuing the logrotate command.

In general you should use --logappend with --logpath and use something
like the logrotate linux tool
(http://linuxcommand.org/man_pages/logrotate8.html); it can cap the
size of the log files for you.

> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>
>

prashant

unread,
Mar 21, 2011, 1:01:18 PM3/21/11
to mongodb-user
ok thanks! this helps!

Prashant


On Mar 21, 11:50 am, Scott Hernandez <scotthernan...@gmail.com> wrote:
> http://www.mongodb.org/display/DOCS/Logginghas more info.
>
> If you don't use --logappend then when you start mongod it will
> over-write the log file. I will have to check on the behavior of no
> --logappend and issuing the logrotate command.
>
> In general you should use --logappend with --logpath and use something
> like the logrotate linux tool
> (http://linuxcommand.org/man_pages/logrotate8.html);it can cap the
> size of the log files for you.
>
Reply all
Reply to author
Forward
0 new messages