I have configured the following settings in PostgreSQL 13 on Windows.
logging_collector = on
log_rotation_size='100MB'
log_truncate_on_rotation = on
log_filename ='postgresql-%Y-%m-%d.log'
I have configured PostgreSQL to create a daily log. Is it possible for PostgreSQL to create another file (with the configured file name) and rename the existing file by appending with a different file name when the file reaches its configured log_rotation_size?
Do I have to run some script or services on the background so that the program is able to monitor the data/logs folder and rename the file when the log file size reaches the limit?
On Linux you would have PostgreSQL create a log with a simple name (such as postgresql.log) and then configure logrotate to manage the PostgreSQL log, rotating and deleting it as you require.
Information to support this (though not telling you how to do this) is in the PostgreSQL docs section on log file maintenance.
However, on Windows you (probably) won't have this option, so how the file is rotated is up to you, whether by a script or some other utility.