Deprecated Package Version
Reason: Other, Legacy
This version is out of support and is no longer maintained. Please upgrade to the latest version. See our support policy for details: https://aka.ms/dotnet/aspire/support
Install
| Product | Versions |
|---|---|
| .NET |
README
Aspire.Seq Library
Adds OTLP exporters to send logs and traces to a Seq server. Can be configured to persist logs and traces across application restarts.
By default, Seq is not added to the Aspire manifest for deployment.
Getting started
Prerequisites
- Seq server
Install the package
Install the .NET Aspire Seq library with NuGet:
dotnet add package Aspire.Seq
Usage example
In the Program.cs file of your projects, call the AddSeqEndpoint extension method to register OpenTelemetry Protocol exporters to send logs and traces to Seq. The method takes a connection name parameter.
builder.AddSeqEndpoint("seq");
Logs and traces will then be sent to Seq, in addition to the .NET Aspire dashboard.
Configuration
The .NET Aspire Seq component provides options to configure the connection to Seq.
Use configuration providers
The .NET Aspire Seq component supports Microsoft.Extensions.Configuration. It loads the SeqSettings from configuration by using the Aspire:Seq key. Example appsettings.json that configures some of the options:
{
"Aspire": {
"Seq": {
"DisableHealthChecks": true,
"ServerUrl": "http://localhost:5341"
}
}
}
Use inline delegates
Also you can pass the Action<SeqSettings> configureSettings delegate to set up some or all the options inline, for example to disable health checks from code:
builder.AddSeqEndpoint("seq", settings => {
settings.DisableHealthChecks = true;
settings.ServerUrl = "http://localhost:5341";
settings.Logs.TimeoutMilliseconds = 10000;
});
AppHost extensions
In your AppHost project, install the Aspire.Hosting.Seq library with NuGet:
dotnet add package Aspire.Hosting.Seq
Then, in the AppHost.cs file of AppHost, register a Seq server and propagate its configuration using the following methods (note that you must accept the Seq End User License Agreement for Seq to start):
var seq = builder.AddSeq("seq");
var myService = builder.AddProject<Projects.MyService>()
.WithReference(seq);
In the Program.cs file of MyService, logging and tracing to Seq can be configured with:
builder.AddSeqEndpoint("seq");
Persistent logs and traces
To retain Seq's data and configuration across application restarts register Seq with a data directory in your AppHost project.
var seq = builder.AddSeq("seq", seqDataDirectory: "./seqdata");
Note that the directory specified must already exist.
Seq in the .NET Aspire manifest
Seq is not part of the .NET Aspire deployment manifest. It is recommended to set up a secure production Seq server outside of .NET Aspire.
Additional documentation
- https://docs.datalust.co/docs/the-seq-query-language
- https://github.com/dotnet/aspire/tree/main/src/Components/README.md
Feedback & contributing
Changes from Previous Version
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.