extern function log_rotate