preprocess logs