Only flush if logger support it