May 30, 2010, 8:47:34 AM5/30/10
You can use the print() method. If it can't output to stdout ( I think it use stdout), It will print to the log file.
So if you put a print method, it will print things to your log file...
I'd use the mongo shell in a terminal.. and I would use tail -f "log file" to see the output flow in real time.
I heard about a way to debug js within firebug using the mongo shell emulator. Not sure if it works fine.
the print() method should be a good start.