That original file is still being held open by mongod despite the fact that you moved it, and it will continue to be the file it logs to until you stop the mongod process or try the following:
- Remove the new
mongod.log file you created in /var/log/mongodb
- Move the old
mongod.log file back in to /var/log/mongodb
- Issue the
logRotate command from the mongo shell (when connected to the relevant mongod)
Note: Alternatively for step 3 you can send a kill -SIGUSR1 <pid of mongod> to achieve the same thing.
Once this is done, you will now have a new smaller mongod.log file in the folder, along with the truncated previous file (no longer being written to). The exact name depends on the version you are rinning which you have not mentioned but you are now free to move the large log files out to another directory (I would recommend compressing them, they are easily compressed).
If the size is a regular issue, I would recommend doing this as a cron job or similar to automate the process going forward.