db.getLogComponents()

Definition

  • db.getLogComponents()

New in version 3.0.

Returns the current verbosity settings. The verbosity settingsdetermine the amount of Log Messages that MongoDBproduces for each log message component.

If a component inherits the verbosity level of its parent,db.getLogComponents() displays -1 for the component’sverbosity.

Output

The db.getLogComponents() returns a document with theverbosity settings. For example:

  1. {
  2. "verbosity" : 0,
  3. "accessControl" : {
  4. "verbosity" : -1
  5. },
  6. "command" : {
  7. "verbosity" : -1
  8. },
  9. "control" : {
  10. "verbosity" : -1
  11. },
  12. "geo" : {
  13. "verbosity" : -1
  14. },
  15. "index" : {
  16. "verbosity" : -1
  17. },
  18. "network" : {
  19. "verbosity" : -1
  20. },
  21. "query" : {
  22. "verbosity" : 2
  23. },
  24. "replication" : {
  25. "verbosity" : -1,
  26. "election" : {
  27. "verbosity" : -1
  28. },
  29. "heartbeats" : {
  30. "verbosity" : -1
  31. },
  32. "initialSync" : {
  33. "verbosity" : -1
  34. },
  35. "rollback" : {
  36. "verbosity" : -1
  37. }
  38. },
  39. "sharding" : {
  40. "verbosity" : -1
  41. },
  42. "storage" : {
  43. "verbosity" : 2,
  44. "recovery" : {
  45. "verbosity" : -1
  46. },
  47. "journal" : {
  48. "verbosity" : -1
  49. }
  50. },
  51. "write" : {
  52. "verbosity" : -1
  53. }
  54. }

To modify these settings, you can configure thesystemLog.verbosity andsystemLog.component.<name>.verbosity settings in theconfiguration file or set thelogComponentVerbosity parameter using thesetParameter command or use the db.setLogLevel()method. For examples, see Configure Log Verbosity Levels.