revised log filter code

revised log filtering code