Cherry picking log rotation fix to stable