Skip to content

Clean up and fix Seq doc issues #1008

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 29 additions & 39 deletions docs/logging/seq-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: .NET Aspire Seq component
description: Learn how to use the .NET Aspire Seq component to add OpenTelemetry Protocol (OTLP) exporters that send logs and traces to a Seq Server.
ms.topic: how-to
ms.date: 05/14/2024
ms.date: 05/29/2024
---

# .NET Aspire Seq component
Expand Down Expand Up @@ -62,12 +62,39 @@ dotnet add package Aspire.Hosting.Seq
In your app host project, register a Seq database and consume the connection using the following methods:

```csharp
var seq = builder.AddSeq("seq");
var seq = builder.AddSeq("seq")
.ExcludeFromManifest();

var myService = builder.AddProject<Projects.MyService>()
.WithReference(seq);
```

The preceding code registers a Seq server and propagates its configuration.

> [!IMPORTANT]
> You must accept the [Seq End User Licence Agreement](https://datalust.co/doc/eula-current.pdf) for Seq to start):

In the _:::no-loc text="Program.cs":::_ file of the **MyService** project, configure logging and tracing to Seq using the following code:

```csharp
builder.AddSeqEndpoint("seq");
```

### Seq in the .NET Aspire manifest

Seq shouldn't be part of the .NET Aspire deployment manifest, hence the chained call to `ExcludeFromManifest`. It's recommended you set up a secure production Seq server outside of .NET Aspire.

### Persistent logs and traces

Register Seq with a data directory in your AppHost project to retain Seq's data and configuration across application restarts.

```csharp
var seq = builder.AddSeq("seq", seqDataDirectory: "./seqdata")
.ExcludeFromManifest();
```

The directory specified must already exist.

## Configuration

The .NET Aspire Seq component provides options to configure the connection to Seq.
Expand Down Expand Up @@ -99,43 +126,6 @@ builder.AddSeqEndpoint("seq", static settings =>
});
```

## AppHost extensions

In your AppHost project, install the `Aspire.Hosting.Seq` library with [NuGet](https://www.nuget.org):

```dotnetcli
dotnet add package Aspire.Hosting.Seq
```

Then, in the _:::no-loc text="Program.cs":::_ file of the **.AppHost** project, register a Seq server and propagate its configuration using the following methods (note that you must accept the [Seq End User Licence Agreement](https://datalust.co/doc/eula-current.pdf) for Seq to start):

```csharp
var seq = builder.AddSeq("seq");

var myService = builder.AddProject<Projects.MyService>()
.WithReference(seq);
```

In the _:::no-loc text="Program.cs":::_ file of the **MyService** project, configure logging and tracing to Seq using the following code:

```csharp
builder.AddSeqEndpoint("seq");
```

### Persistent logs and traces

Register Seq with a data directory in your AppHost project to retain Seq's data and configuration across application restarts.

```csharp
var seq = builder.AddSeq("seq", seqDataDirectory: "./seqdata");
```

The directory specified must already exist.

### Seq in the .NET Aspire manifest

Seq isn't part of the .NET Aspire deployment manifest. It's recommended you set up a secure production Seq server outside of .NET Aspire.

[!INCLUDE [component-health-checks](../includes/component-health-checks.md)]

The .NET Aspire Seq component handles the following:
Expand Down
Loading