We are using MongoDB 4.0.4 version for our project. The database configuration is done as below:
- Created a custom database in MongoDB and the service is running in authentication mode.
- Using Windows systems (Server and Desktop both)
We have observed that the MongoDB log file size gets increased over the period and consumes disk space in GBs. Mongo creates a new log file only after the MongoDB service is rebooted. Due to the large size issue, we want to do either:
- Control the entries in the log file (We have tried by setting different verbose levels)
- Use logrotate command (The command doesn't work on Windows as intended, though we have read it on forums that it supports only Linux)
- Delete log files (We can manually delete all log files, but when we try to delete it programmatically through windows service, it only deletes backup files, but the active file gives an error as file in use)
Is there any other solution that we can try? Thanks in advance.