![]() |
VOOZH | about |
dotnet add package Seq.Extensions.Logging --version 9.0.0
NuGet\Install-Package Seq.Extensions.Logging -Version 9.0.0
<PackageReference Include="Seq.Extensions.Logging" Version="9.0.0" />
<PackageVersion Include="Seq.Extensions.Logging" Version="9.0.0" />Directory.Packages.props
<PackageReference Include="Seq.Extensions.Logging" />Project file
paket add Seq.Extensions.Logging --version 9.0.0
#r "nuget: Seq.Extensions.Logging, 9.0.0"
#:package Seq.Extensions.Logging@9.0.0
#addin nuget:?package=Seq.Extensions.Logging&version=9.0.0Install as a Cake Addin
#tool nuget:?package=Seq.Extensions.Logging&version=9.0.0Install as a Cake Tool
Seq is a flexible self-hosted back-end for the ASP.NET Core logging subsystem (Microsoft.Extensions.Logging). Log events generated by the framework and application code are sent over HTTP to a Seq server, where the structured data associated with each event is used for powerful filtering, correlation, and analysis.
For an example, see the dotnetconf deep dive session.
This package makes it a one-liner to configure ASP.NET Core logging with Seq.
The instructions that follow are for .NET 6.0+ web applications.
Add the NuGet package to your project either by editing the CSPROJ file, or using the NuGet package manager:
dotnet add package Seq.Extensions.Logging
In Program.cs, call AddSeq() on the host's ILoggingBuilder.
// Use the Seq logging configuration in appsettings.json
builder.Host.ConfigureLogging(loggingBuilder =>
loggingBuilder.AddSeq());
The framework will inject ILogger instances into controllers and other classes:
class HomeController : Controller
{
readonly ILogger<HomeController> _log;
public HomeController(ILogger<HomeController> log)
{
_log = log;
}
public IActionResult Index()
{
_log.LogInformation("Hello, world!");
}
}
Log messages will be sent to Seq in batches and be visible in the Seq user interface. Observe that correlation identifiers added by the framework, like RequestId, are all exposed and fully-searchable in Seq.
Seq supports the templated log messages used by Microsoft.Extensions.Logging. By writing events with named format placeholders, the data attached to the event preserves the individual property values.
var fizz = 3, buzz = 5;
log.LogInformation("The current values are {Fizz} and {Buzz}", fizz, buzz);
This records an event like:
| Property | Value |
|---|---|
Message |
"The current values are 3 and 5" |
Fizz |
3 |
Buzz |
5 |
Seq makes these properties searchable without additional log parsing. For example, a filter expression like Fizz < 4 would match the event above.
The AddSeq() method exposes some basic options for controlling the connection and log volume.
| Parameter | Description | Example value |
|---|---|---|
apiKey |
A Seq API key to authenticate or tag messages from the logger | "1234567890" |
levelOverrides |
A dictionary mapping logger name prefixes to minimum logging levels | new Dictionary<string,LogLevel>{ ["Microsoft"] = LogLevel.Warning } |
minimumLevel |
The level below which events will be suppressed (the default is Information) |
LogLevel.Trace |
The logging level, Seq server URL, API key and other settings can be read from JSON configuration if desired.
In appsettings.json add a "Seq" property to "Logging" to configure the server URL, API key, and levels for the Seq provider:
{
"Logging": {
"LogLevel": {
"Default": "Information"
},
"Seq": {
"ServerUrl": "http://localhost:5341",
"ApiKey": "1234567890",
"LogLevel": {
"System": "Information",
"Microsoft": "Warning"
}
}
}
}
The logging provider will dynamically adjust the default logging level up or down based on the level associated with an API key in Seq. For further information see the Seq documentation.
The logging provider ships with a JsonSafeString type that can be used to communicate to the logger that a string contains valid JSON, which can be safely included in a log event as structured data.
var json = "{\"A\": 42}";
_logger.LogInformation("The answer is {Answer}", new JsonSafeString(json));
The Seq logger provider automatically adds trace and span ids to events when present, enabling the Trace drop-down menu in Seq's expanded event view.
ASP.NET Core may add additional top-level TraceId, SpanId, and ParentId properties in its default configuration. You can remove these if you wish, using ILoggingBuilder.Configure():
builder.Logging.Configure(opts => {
opts.ActivityTrackingOptions = ActivityTrackingOptions.None;
});
You can add additional structured data to events being sent to Seq by specifying enricher callbacks in the AddSeq() method:
.AddSeq(enrichers: [evt => evt.AddOrUpdateProperty(
"ThreadId",
Environment.CurrentManagedThreadId)
]))
Nothing showed up, what can I do?
If events don't appear in Seq after pressing the refresh button in the filter bar, either your application was unable to contact the Seq server, or else the Seq server rejected the log events for some reason.
The Seq server may reject incoming events if they're missing a required API key, if the payload is corrupted somehow, or if the log events are too large to accept.
Server-side issues are diagnosed using the Seq Ingestion Log, which shows the details of any problems detected on the server side. The ingestion log is linked from the Settings > Diagnostics page in the Seq user interface.
If there's no information in the ingestion log, the application was probably unable to reach the server because of network configuration or connectivity issues. These are reported to the application through SelfLog.
Add the following line after the logger is configured to print any error information to the console:
Seq.Extensions.Logging.SelfLog.Enable(Console.Error);
If the console is not available, you can pass a delegate into SelfLog.Enable() that will be called with each error message:
Seq.Extensions.Logging.SelfLog.Enable(message => {
// Do something with `message`
});
SelfLog as described above to check for connectivity problems and other issues on the client side.The major version of this package tracks the major version of its Microsoft.Extensions.Logging dependency. So, if your
application (on any target runtime) is targeting net6.0, use the latest 6.* version of this package. Likewise, if
you're targeting net8.0, target a 8.* version of Seq.Extensions.Logging for the best experience.
This package is based on a subset of Serilog. Not all of the options supported by the Serilog and Seq client libraries are present in the Seq.Extensions.Logging package.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on Seq.Extensions.Logging:
| Package | Downloads |
|---|---|
|
FenixAlliance.ACL.Dependencies
Application Component for the Alliance Business Suite. |
|
|
DevSDK
Proje Geliştirme Araçları |
|
|
Jakar.Database
Package Description |
|
|
ITgenerator.Web
Package Description |
|
|
GR.Logger
Package Description |
Showing the top 7 popular GitHub repositories that depend on Seq.Extensions.Logging:
| Repository | Stars |
|---|---|
|
testcontainers/testcontainers-dotnet
A library to support tests with throwaway instances of Docker containers for all compatible .NET Standard versions.
|
|
|
Mimetis/Dotmim.Sync
A brand new database synchronization framework, multi platform, multi databases, developed on top of .Net Standard 2.0. https://dotmimsync.readthedocs.io/
|
|
|
andrewlock/asp-dot-net-core-in-action-2e
Source code examples for ASP.NET Core in Action, Second Edition
|
|
|
andrewlock/asp-dot-net-core-in-action-3e
Source code examples for ASP.NET Core in Action, Third Edition
|
|
|
andrewlock/asp-dot-net-core-in-action
Source code examples for ASP.NET Core in Action
|
|
|
kawser2133/web-api-project
Explore a meticulously crafted ASP.NET Core Web API, featuring Security Identity, JWT, Unit Testing, and API Versioning. This repository embodies best coding practices, delivering a clean, efficient, and scalable solution.
|
|
|
v0l/void.cat
Free file hosting website
|
| Version | Downloads | Last Updated |
|---|---|---|
| 9.0.0 | 537,606 | 10/9/2025 |
| 9.0.0-dev-00142 | 227 | 10/9/2025 |
| 9.0.0-dev-00141 | 210 | 10/9/2025 |
| 9.0.0-dev-00140 | 225 | 10/9/2025 |
| 9.0.0-dev-00138 | 226 | 10/8/2025 |
| 9.0.0-dev-00129 | 35,874 | 12/20/2024 |
| 9.0.0-dev-00127 | 243 | 12/19/2024 |
| 8.0.1-dev-00124 | 3,946 | 8/21/2024 |
| 8.0.1-dev-00123 | 227 | 8/21/2024 |
| 8.0.1-dev-00119 | 1,147 | 8/19/2024 |
| 8.0.0 | 2,725,849 | 1/28/2024 |
| 8.0.0-dev-00115 | 245 | 1/28/2024 |
| 8.0.0-dev-00113 | 248 | 1/28/2024 |
| 6.1.0 | 4,635,027 | 8/9/2022 |
| 6.1.0-dev-00103 | 402 | 8/8/2022 |
| 6.1.0-dev-00091 | 18,171 | 4/27/2021 |
| 6.0.2-dev-00090 | 489 | 4/27/2021 |
| 6.0.0 | 2,690,530 | 1/12/2021 |
| 6.0.0-dev-00086 | 611 | 1/7/2021 |
| 5.0.0 | 37,709 | 1/6/2021 |