# TestingUtils Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.utils.testingutils/)

## ConfigureDefaultLoggingBuilder(ILoggingBuilder, string) {#configuredefaultloggingbuilder-microsoft-extensions-logging-iloggingbuilder-stri-09425f29}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.utils.testingutils/methods/configuredefaultloggingbuilder-microsoft-extensions-logging-iloggingbuilder-stri-09425f29/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.TestingHost/Utils/TestingUtils.cs#L26-L27)

```csharp
public static void ConfigureDefaultLoggingBuilder(ILoggingBuilder builder, string filePath)
```

Configure `builder` with a [FileLoggerProvider](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.logging.fileloggerprovider/) which logs to `filePath` by default;

### Parameters

- `builder` (`ILoggingBuilder`): The builder.
- `filePath` (`string`): The file path.

## CreateDefaultLoggerFactory(string) {#createdefaultloggerfactory-string-e411e962}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.utils.testingutils/methods/createdefaultloggerfactory-string-e411e962/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.TestingHost/Utils/TestingUtils.cs#L57)

```csharp
public static ILoggerFactory CreateDefaultLoggerFactory(string filePath)
```

Create the default logger factory, which would configure logger factory with a [FileLoggerProvider](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.logging.fileloggerprovider/) that writes logs to `filePath` and console. by default;

### Parameters

- `filePath` (`string`): The file path.

### Returns

ILoggerFactory.

## CreateDefaultLoggerFactory(string, LoggerFilterOptions) {#createdefaultloggerfactory-string-microsoft-extensions-logging-loggerfilteroptio-7698064d}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.utils.testingutils/methods/createdefaultloggerfactory-string-microsoft-extensions-logging-loggerfilteroptio-7698064d/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.TestingHost/Utils/TestingUtils.cs#L69-L71)

```csharp
public static ILoggerFactory CreateDefaultLoggerFactory(string filePath, LoggerFilterOptions filters)
```

Create the default logger factory, which would configure logger factory with a [FileLoggerProvider](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.logging.fileloggerprovider/) that writes logs to `filePath` and console. by default;

### Parameters

- `filePath` (`string`): the logger file path
- `filters` (`LoggerFilterOptions`): log filters you want to configure your logging with

## CreateTraceFileName(string, string) {#createtracefilename-string-string-cf16c8cb}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.utils.testingutils/methods/createtracefilename-string-string-cf16c8cb/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.TestingHost/Utils/TestingUtils.cs#L39-L46)

```csharp
public static string CreateTraceFileName(string nodeName, string clusterId)
```

Create trace file name for a specific node or client in a specific deployment

### Parameters

- `nodeName` (`string`): Name of the node.
- `clusterId` (`string`): The cluster identifier.

### Returns

The new trace file name.

## Multiply(TimeSpan, double) {#multiply-system-timespan-double-1bea44cf}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.utils.testingutils/methods/multiply-system-timespan-double-1bea44cf/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.TestingHost/Utils/TestingUtils.cs#L118-L120)

```csharp
public static TimeSpan Multiply(TimeSpan time, double value)
```

Multiply a timeout by a value

### Parameters

- `time` (`TimeSpan`): The time.
- `value` (`double`): The value.

### Returns

The resulting time span value.

## WaitUntilAsync(Func&lt;bool, Task&lt;bool&gt;&gt;, TimeSpan, TimeSpan?) {#waituntilasync-system-func-bool-system-threading-tasks-task-bool-system-timespan-287dfc1e}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.utils.testingutils/methods/waituntilasync-system-func-bool-system-threading-tasks-task-bool-system-timespan-287dfc1e/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.TestingHost/Utils/TestingUtils.cs#L81-L108)

```csharp
public static Task WaitUntilAsync(Func<bool, Task<bool>> predicate, TimeSpan timeout, TimeSpan? delayOnFail = null)
```

Run the predicate until it succeed or times out

### Parameters

- `predicate` (`Func<bool, Task<bool>>`): The predicate to run
- `timeout` (`TimeSpan`): The timeout value
- `delayOnFail` (`TimeSpan?`): The time to delay next call upon failure

### Returns

True if the predicate succeed, false otherwise
