I followed the official Mongodb configuration guide as described here,
Optional. Create a specific directory for MongoDB log files:md C:\mongodb\log
Optional. 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.