log trimming