I followed the official Mongodb configuration guide as described here,
http://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/
Optional. Create a specific directory for MongoDB log files:
md C:\mongodb\logOptional. Create a configuration file for the logpath option for MongoDB in the Command Promptby issuing this command:
echo logpath=C:\mongodb\log\mongo.log > C:\mongodb\mongod.cfg
However, the mongod kept failing from a Powershell environment.
error command line: unrecognized line in ‘ ■l’
use –help for help
When the Powershell created a mongod.cfg file by using echo command, it basically filled the content as unicode by default so that mongod.exe coudn’t read it. Here is another SO thread talking the same problem: http://stackoverflow.com/questions/16930382/unrecognized-character-when-creating-mongodb-service
Solution: Save the .cfg file to use ANSI encoding, not UTF8 or UTF16.