# JournalingHostingExtensions.AddJournalStorage(ISiloBuilder, string, Func&lt;IServiceProvider, TProvider&gt;)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.journaling.journalinghostingextensions/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.journaling.journalinghostingextensions/methods/)

[Source](https://github.com/dotnet/orleans/blob/6a0e937f544c35ffcf11b37e4c2b7de5a1580a03/src/Orleans.Durable/Journaling/JournalingHostingExtensions.cs#L173-L244)

```csharp
public static ISiloBuilder AddJournalStorage<TProvider>(this ISiloBuilder builder, string name, Func<IServiceProvider, TProvider> factory)
```

Registers a named journal storage provider and its journaled state manager factory.

### Parameters

- `builder` (`ISiloBuilder`): The silo builder.
- `name` (`string`): The provider name.
- `factory` (`Func<IServiceProvider, TProvider>`): The factory which creates the singleton provider.

### Returns

The silo builder.

### Exceptions

- `System.ArgumentNullException`: The builder or factory is null.
- `System.ArgumentException`: The provider name is empty or whitespace.
- `System.InvalidOperationException`: The name is already registered with another provider type.
