How can I specify the conditions under which logRotate occurs?

As I understand it, in /etc/mongod.conf

systemLog:
  logAppend: true
  logRotate: rename
  1. When I set logRotate to “rename”, MongoDB will automatically save the file under a different name and open a new file when the rotate occurs.

  2. When I set logRotate to “reopen”, MongoDB just closes and opens the file when the rotate occurs. (because mongodb expect linux to take care of it)

Is it right?

Then, when set to “rename”, how do I make the log file size exceed a certain size or logRotate to occur automatically at a certain time?

As with “reopen”, do I need to create /etc/logrotate.d/mongod file to configure it?

I am using the latest version.
/etc/mongod.conf file,

systemLog:
  logAppend: true
  logRotate: rename
  logRotateTime: midnight
  logRotateSize: 100

the chatGPT says that I can specify options called logRotateSize and logRotateTime, but if I add those, an error occurs. Was this in an older version and then disappeared? or Is chatGPT telling the wrong information?

Thanks.

At lease from latest manual, i don’t see such an option.

Thanks. could you know about first question?

I wonder if I understand the difference between rename and reopen correctly.