Add the method to flush all cached logs.