Following are the Steps to delete logs:
Go to path C:\Program Files\MongoDB\Server\4.2\bin\
And run the deleteLogMessagesLogs.js file.
Add the Batch file in Task Scheduler for auto cleanup: Run Removelogmessagescollection.bat
3. From the Task Scheduler , run the following job:
Files required: ( * change the extension from jsp to js and batt to bat )