Separate sample and log functions to allow different rates