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
You have two options to increase your log verbosity.
Increase your log verbosity in configuration file. systemLog.component.query.verbosity = 4 see systemLog.component.query.verbosity documentation
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