content_image/739401.jpg
<img src='content_image/739401.jpg'>

## Process Logging 

During normal operation, mongod and mongos instances report a live account of all server activity and operations to either standard output or a log file. The following runtime settings control these options. 

• quiet . Limits the amount of information written to the log or output. 

• verbosity . Increases the amount of information written to the log or output. You can also modify the logging verbosity during runtime with the logLevel parameter or the db.setLogLevel() method in the shell. 

• path . Enables logging to a file, rather than the standard output. You must specify the full path to the log file when adjusting this setting. 

• logAppend . Adds information to a log file instead of overwriting the file. 

Note: You can specify these configuration operations as the command line arguments to mongod or mongos 

For example: 

mongod -v --logpath /var/log/mongodb/server1.log --logappend 

Starts a mongod instance in verbose mode, appending data to the log file at /var/log/mongodb/server1.log/ . 

The following database commands also affect logging: 

• getLog . Displays recent messages from the mongod process log. 

• logRotate . Rotates the log files for mongod processes only. See Rotate Log Files (page 231). 

## Diagnosing Performance Issues 

As you develop and operate applications with MongoDB, you may want to analyze the performance of the database as the application. Analyzing MongoDB Performance (page 213) discusses some of the operational factors that can influence performance. 

