More robust S3 log reading