flush logs every second