I've gone through the postgres documentation and I've enabled the logging using the below configuration settings
log_statement = 'none'
log_min_duration_statement = 500
logging_collector = on
log_directory = '/var/postgreslog'
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
log_truncate_on_rotation = on
log_rotation_age = 1d
log_file_mode = 0600
When I looked at the documentation to check how these log files are retained, I found the below information
Note that all the solutions described above take care of starting new log files at configurable intervals, but they do not handle the deletion of old, no-longer-useful log files. You will probably want to set up a batch job to periodically delete old log files. Another possibility is to configure the rotation program so that old log files are overwritten cyclically.
I've selected the log file name with the combination of Year month date and timestamp and rotating the logs daily, so how many old log files gets retained?