Question: I was wondering how I can setup log rotation for a MongoDB on Windows. 

I'm only reading it for Linux and Unix based systems in the documentation. Does anyone know how I can set this up?

<https://docs.mongodb.com/manual/tutorial/rotate-log-files/#forcing-a-log-rotation-with-sigusr1>

Answer: 
I found out that MongoDB has it's own logRoation for Windows build in. 

Rotate the log file by issuing the logRotate command from the admin database in a mongo shell:

```
use admin
db.runCommand( { logRotate : 1 } )

```

<https://docs.mongodb.com/manual/tutorial/rotate-log-files/#rotate-the-log-file>

EDIT:

Stennie told in the comment below that you can even do 

```
db.adminCommand( { logRotate : 1 } )

```

or 

```
db.adminCommand('logRotate')

```
That's because log rotation is not a feature of MongoDB but of the Syslog. Windows has completely different object based way of handling this: the [Windows Event Log](https://msdn.microsoft.com/en-us/library/windows/desktop/aa385780(v=vs.85).aspx).

If MongoDB on Windows writes log files similar to the Linux/Unix version, you'd need a third party solution for handling the log rotation. There seems to be [LogRotateWin](https://sourceforge.net/p/logrotatewin/wiki/LogRotate/).