title: Configuring MongoDB on Windows
body: <p>I am trying to set up MongoDB on Windows, and the online docs seem far from accurate.</p>
  
  <p>Under "Configure a Windows Service" part, <a href="http://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/#configure-directories-and-files" rel="noreferrer">step 1</a> mentions to create a config file. Then it mentions to fill in the file with a line in the format <code>logpath="X:\path\mongo.log"</code>. However, following the link, the config file is said to be in YAML format, which renders the previous line unreadable in YAML.</p>
  
  <p>I have created a basic <code>mongodb.cfg</code>(<code>.cfg</code> or <code>.conf</code>??) file:</p>
  
  <pre><code>systemLog:
     destination: file
     path: "P:\\Servers\\MongoDB\\logs\\mongodb.log"
     quiet: true
     logAppend: true
  storage:
     dbPath: "P:\\Servers\\MongoDB\\data"
     journal:
        enabled: true
  net:
     bindIp: 127.0.0.1
     port: 27017
  </code></pre>
  
  <p>However when I start <code>mongod --config P:\Servers\MongoDB\mongodb.cfg</code>, the service just won't give any output at all, and just hangs.</p>
  
  <p>If I remove the <code>dbPath</code> line, it will just close itself with no message at all.</p>
  
  <p>I have also tried to leave the <code>mongodb.cfg</code> file just like this:</p>
  
  <pre><code>logpath="P:\Servers\MongoDB\logs\mongodb.log"
  dbpath="P:\Servers\MongoDB\data"
  </code></pre>
  
  <p>But execution aborts complaining about any of the 2 paths, even tho they exist. Tried with single backslashes and with escaped backslashes (<code>\\</code>) with no success.</p>
  
  <p>The only way the service works and listens for connections is to manually pass <code>--dbpath</code> only, and <strong>ignore any config file and logpath</strong> at all. Obviously this is not serious, as I need to keep track of the logs and also might need to change config parameters at some later point.</p>
  
  <p>This is nuts... Am I missing something very basic or this docs are a real mess?</p>