Raycynix.Extensions.Serilog.Aspire
3.0.0
dotnet add package Raycynix.Extensions.Serilog.Aspire --version 3.0.0
NuGet\Install-Package Raycynix.Extensions.Serilog.Aspire -Version 3.0.0
<PackageReference Include="Raycynix.Extensions.Serilog.Aspire" Version="3.0.0" />
<PackageVersion Include="Raycynix.Extensions.Serilog.Aspire" Version="3.0.0" />
<PackageReference Include="Raycynix.Extensions.Serilog.Aspire" />
paket add Raycynix.Extensions.Serilog.Aspire --version 3.0.0
#r "nuget: Raycynix.Extensions.Serilog.Aspire, 3.0.0"
#:package Raycynix.Extensions.Serilog.Aspire@3.0.0
#addin nuget:?package=Raycynix.Extensions.Serilog.Aspire&version=3.0.0
#tool nuget:?package=Raycynix.Extensions.Serilog.Aspire&version=3.0.0
Raycynix.Extensions.Serilog.Aspire
Raycynix.Extensions.Serilog.Aspire adds the Raycynix Serilog pipeline to an
Aspire AppHost through IDistributedApplicationBuilder.
Compatibility
- .NET 10
- Aspire.Hosting 13.4.6
Raycynix.Extensions.Serilog3.0.0
Installation
dotnet add package Raycynix.Extensions.Serilog.Aspire
AppHost registration
using Raycynix.Extensions.Serilog.Aspire;
var builder = DistributedApplication.CreateBuilder(args);
builder.AddRaycynixSerilog();
builder.AddProject<Projects.Api>("api");
builder.AddProject<Projects.Worker>("worker");
builder.Build().Run();
The extension returns the same IDistributedApplicationBuilder, so normal
Aspire resource registration can continue fluently.
What the package configures
The package configures the logging pipeline of the AppHost process itself. It uses the same behavior as the core package:
- standard Microsoft
ILogger<T>integration; - native
Serilogconfiguration; Raycynix:Serilogmetadata conventions;- dependency-injected Serilog components;
- fallback console output;
- ordered logger and sink configurators.
Aspire resources are separate processes. AppHost service registration cannot modify the DI container of an orchestrated API, worker, executable, or container.
Configure every .NET resource
Each orchestrated .NET project should reference
Raycynix.Extensions.Serilog and register it in its own host:
using Raycynix.Extensions.Serilog;
var builder = WebApplication.CreateBuilder(args);
builder.AddRaycynixSerilog();
var app = builder.Build();
app.Run();
For solutions with a shared ServiceDefaults project, place the core registration in the shared host-builder extension used by each service. Keep the Aspire package in AppHost only.
AppHost configuration
The AppHost reads the same sections as the core package:
{
"Raycynix": {
"Serilog": {
"ServiceName": "commerce-apphost",
"Environment": "Development"
}
},
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"Aspire": "Information",
"Microsoft": "Warning",
"System": "Warning"
}
},
"WriteTo": [
{
"Name": "Console"
}
]
}
}
If Serilog:WriteTo is omitted, the core fallback console sink is used.
Configuration in code
The overload exposes the standard RaycynixSerilogBuilder callback:
builder.AddRaycynixSerilog(logging =>
{
logging.Options.ServiceName = "commerce-apphost";
logging.Options.ApplyDefaultLevelOverrides = false;
logging.ConfigureLogger((context, configuration) =>
configuration.Enrich.WithProperty("Orchestrator", "Aspire"));
});
Optional sinks
Optional Raycynix sink packages compose through the same callback. For example,
after installing Raycynix.Extensions.Serilog.Elastic:
using Raycynix.Extensions.Serilog.Aspire;
using Raycynix.Extensions.Serilog.Elastic;
builder.AddRaycynixSerilog(logging =>
{
logging.AddElastic();
});
This adds Elastic output to AppHost only. Resource projects require their own sink registration and configuration.
Registration rules
Call AddRaycynixSerilog() once for the AppHost service collection. Duplicate
registration throws InvalidOperationException, matching the core package.
The Aspire package deliberately contains no resource annotations and does not inject logging configuration into child resources. This keeps secrets, environment-specific sink choices, and resource logging lifecycles explicit.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Aspire.Hosting (>= 13.4.6)
- Raycynix.Extensions.Serilog (>= 3.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0 | 86 | 8/10/2026 |
v3.0.0 adds AddRaycynixSerilog for Aspire IDistributedApplicationBuilder, configures the AppHost process through the shared Raycynix Serilog pipeline, supports the core configuration callback and optional sink integrations, and documents the separate logging lifecycle of orchestrated resources.