turn off query logging

1,058 views
Skip to first unread message

Alexey Ivanov

unread,
Sep 13, 2011, 7:00:42 AM9/13/11
to mongod...@googlegroups.com
Hello!
In my application I use mongodb. It performs queries with tons of parameters pretty frequent. And it produces huge log files. Is there any way to turn off logging of queries?

Thanks in advance,
    Alexey

Nat

unread,
Sep 13, 2011, 7:05:42 AM9/13/11
to mongod...@googlegroups.com
By default querres are not logged. However if it's still too verbose, you can specify --quiet option.
From: Alexey Ivanov <lexa....@gmail.com>
Date: Tue, 13 Sep 2011 04:00:42 -0700 (PDT)
Subject: [mongodb-user] turn off query logging
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mongodb-user/-/C6JWFzm62wkJ.
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.

Alexey Ivanov

unread,
Sep 13, 2011, 7:08:07 AM9/13/11
to mongod...@googlegroups.com, nat....@gmail.com
Thanks for the reply.

Actually I have quiet option on but according to docs it doesn't make any sense for query logging.

Nat

unread,
Sep 13, 2011, 7:12:40 AM9/13/11
to mongod...@googlegroups.com
Query is only logged when it's too slow by defauly. Is that what you saw in your log file? If you don't need to log anything at all, try to --logpath /dev/null.

From: Alexey Ivanov <lexa....@gmail.com>
Date: Tue, 13 Sep 2011 04:08:07 -0700 (PDT)
Subject: Re: [mongodb-user] turn off query logging

Alexey Ivanov

unread,
Sep 13, 2011, 7:16:02 AM9/13/11
to mongod...@googlegroups.com, nat....@gmail.com
I don't know if they are slow or not. If you say it's the default behavior so there is option to change it, isn't it?
And I can't log to /dev/null. I still need to log errors.

Kyle Banker

unread,
Sep 13, 2011, 12:59:43 PM9/13/11
to mongod...@googlegroups.com
By default, queries taking longer than 100ms are logged. If you want to change that threshold, you can do so with the --slowms option.

Alexey Ivanov

unread,
Sep 13, 2011, 2:22:51 PM9/13/11
to mongod...@googlegroups.com
Thanks, Kyle.
This is what I need.
Reply all
Reply to author
Forward
0 new messages