feat (maintainance): optimize log purging (#904)