Raycynix.Extensions.Logging 2.1.0

dotnet add package Raycynix.Extensions.Logging --version 2.1.0
                    
NuGet\Install-Package Raycynix.Extensions.Logging -Version 2.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Raycynix.Extensions.Logging" Version="2.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Raycynix.Extensions.Logging" Version="2.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Raycynix.Extensions.Logging" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Raycynix.Extensions.Logging --version 2.1.0
                    
#r "nuget: Raycynix.Extensions.Logging, 2.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Raycynix.Extensions.Logging@2.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Raycynix.Extensions.Logging&version=2.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Raycynix.Extensions.Logging&version=2.1.0
                    
Install as a Cake Tool

Raycynix.Extensions.Logging

Raycynix.Extensions.Logging provides structured logging services, typed logger adapters, and Serilog host integration for Raycynix applications.

What it contains

  • AddRaycynixLogging(...)
  • AddRaycynixLogging()
  • UseRaycynixLogging(this IHostBuilder, ...)
  • LoggingBuilder
  • LoggingConfiguration
  • Serilog-backed ILogger<T> implementation
  • Console sink setup
  • Serilog integration hooks for optional packages

What it does not contain

  • Elasticsearch sink integration
  • Provider-specific log shipping packages
  • ASP.NET Core middleware

Use Raycynix.Extensions.Logging.Elastic when logs should be written to Elasticsearch.

appsettings.json

{
  "LoggingConfiguration": {
    "ServiceName": "orders-api",
    "ServiceVersion": "1.0.0",
    "Environment": "Production",
    "MinimumLevel": "Information",
    "OutputTemplate": "[{Timestamp:HH:mm:ss}] [{Level:u3}] [{ServiceName}] [{ServiceVersion}] [Env:{Environment}] {Message:lj}{NewLine}{Exception}"
  }
}

Usage

Host.CreateDefaultBuilder(args)
    .UseRaycynixLogging()
    .ConfigureServices((context, services) =>
    {
        services.AddRaycynixLogging(context.Configuration);
        services.AddHostedService<AppWorker>();
    });

For default settings without configuration binding:

Host.CreateDefaultBuilder(args)
    .UseRaycynixLogging()
    .ConfigureServices(services =>
    {
        services.AddRaycynixLogging();
    });

Runtime overrides are applied to the same LoggingConfiguration instance that optional integrations receive:

Host.CreateDefaultBuilder(args)
    .UseRaycynixLogging(options =>
    {
        options.ServiceName = "orders-worker";
        options.MinimumLevel = LogLevel.Debug;
    })
    .ConfigureServices((context, services) =>
    {
        services.AddRaycynixLogging(context.Configuration);
    });

Optional integrations

Optional sinks are added through LoggingBuilder. When the integration needs its own configuration section, use the configuration overload:

Host.CreateDefaultBuilder(args)
    .UseRaycynixLogging()
    .ConfigureServices((context, services) =>
    {
        services
            .AddRaycynixLogging(context.Configuration)
            .AddElastic();
    });

UseRaycynixLogging() must still be called on the host builder because it connects Serilog to the generic host. If AddRaycynixLogging(...) is not registered, UseRaycynixLogging() falls back to the host LoggingConfiguration section and default values.

Injecting the typed logger

public sealed class OrderProcessor(ILogger<OrderProcessor> logger)
{
    public void Process(string orderId)
    {
        logger.Information("Processing order {OrderId}", orderId);
    }
}

AddRaycynixLogging(context.Configuration) also registers LoggingConfiguration through the Raycynix configuration pipeline and validates it on startup.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on Raycynix.Extensions.Logging:

Package Downloads
Raycynix.Extensions.Database

Core Raycynix EF Core database infrastructure with shared DbContext registration, custom context support, model assembly discovery, provider validation, initialization, and model-cache integration.

Raycynix.Extensions.Tracing

Core tracing registration, ActivitySource-based tracer services, and distributed tracing composition for Raycynix applications.

Raycynix.Extensions.Observability

Core observability composition for Raycynix applications, combining logging, metrics, tracing, and ambient operation context registration into a single infrastructure surface.

Raycynix.Extensions.Logging.Elastic

Elasticsearch sink integration for Raycynix Serilog-based logging.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.1.0 5 6/1/2026
2.0.0 200 4/20/2026
1.0.0 252 4/8/2026
0.3.4 187 4/8/2026 0.3.4 is deprecated because it is no longer maintained.

Logging 2.1.0 modularizes optional sinks: Elasticsearch support now lives in Raycynix.Extensions.Logging.Elastic, while the base package provides typed logging, Serilog host integration, configuration binding, and console output.