trim and clean up logging information.