Fix log truncation behavior