cleanup log related functions.