# JsonDurableLogCommandCodec&lt;T&gt;.WriteSnapshot(long, long, long, bool, IReadOnlyCollection&lt;T&gt;, IReadOnlyCollection&lt;LogDraftCommit&gt;, JournalStreamWriter)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.journaling.json.jsondurablelogcommandcodec-1/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.journaling.json.jsondurablelogcommandcodec-1/methods/)

[Source](https://github.com/dotnet/orleans/blob/6a0e937f544c35ffcf11b37e4c2b7de5a1580a03/src/Orleans.Durable/Journaling/Formats/Json/JsonDurableLogCommandCodec.cs#L91-L137)

```csharp
public void WriteSnapshot(long epoch, long firstSequence, long resetSequence, bool isSealed, IReadOnlyCollection<T> items, IReadOnlyCollection<LogDraftCommit> draftCommits, JournalStreamWriter writer)
```

Writes a snapshot command containing the log's state and its retained entries, which begin at `firstSequence`.

### Parameters

- `epoch` (`long`): The identifier of the log's history, or zero when the log has no history.
- `firstSequence` (`long`): The sequence number of the first retained entry.
- `resetSequence` (`long`): The first sequence number after the most recent clear, or zero.
- `isSealed` (`bool`): Whether the log is sealed.
- `items` (`IReadOnlyCollection<T>`): The retained entries.
- `draftCommits` (`IReadOnlyCollection<LogDraftCommit>`): The drafts whose committed entries begin at or after `firstSequence`, in sequence order.
- `writer` (`JournalStreamWriter`): The writer.
