improved auto flush of log module