0

This Questions could not help me: MongoDB logging all queries

Here is my configuration file:

dbpath  = C:\mongodb\data
logpath = C:\mongodb\mongo.log
diaglog = 3                      
profile = 2
slowms  = 1

but my log file contains no queries. What I'm doing wrong?

P.S: I'm using mongodb version v3.2.3

2 Answers 2

1

You have two options to increase your log verbosity.

  1. Increase your log verbosity in configuration file. systemLog.component.query.verbosity = 4 see systemLog.component.query.verbosity documentation

  2. db.setLogLevel(...) see setLogLevel documentation.

your final config file should look like

storage:
   dbPath: "C:\mongodb\data"

systemLog:
   destination: file
   path: "C:\mongodb\mongo.log"
   component:
       query:
           verbosity: 2

operationProfiling:
    slowOpThresholdMs: 100
    mode: slowOp
Sign up to request clarification or add additional context in comments.

3 Comments

ok got: unrecognised option 'systemLog.component.query.verbosity'
@dit what version of mongo are you running?
@dit try increasing the verbosity with the sytnax used here (docs.mongodb.org/v3.0/reference/configuration-options/…)
0

Connect from the mongo shell and run: db.setLogLevel(2,"query")

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.