Syntrony.Logging 1.1.0

dotnet add package Syntrony.Logging --version 1.1.0
                    
NuGet\Install-Package Syntrony.Logging -Version 1.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="Syntrony.Logging" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Syntrony.Logging" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Syntrony.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 Syntrony.Logging --version 1.1.0
                    
#r "nuget: Syntrony.Logging, 1.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 Syntrony.Logging@1.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=Syntrony.Logging&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Syntrony.Logging&version=1.1.0
                    
Install as a Cake Tool

Syntrony.Logging

Unified logging and telemetry package for Syntrony services: a single UseLogging entry point to configure the sink (Log4Net today, Serilog planned) and backend-agnostic OpenTelemetry-based telemetry. No sink is pulled in unless its own package is referenced and its Use* extension is called.

builder.Services.AddSyntrony(options =>
{
    options.UseLogging(log => log
        .SetMinimumLevel(LogLevel.Information)
        .WithEnrichment(p => p["service.name"] = "my-service")
        .UseLog4Net()
        .UseOpenTelemetry(otel =>
        {
            otel.ServiceName = "my-service";
            otel.Endpoint    = builder.Configuration["Telemetry:OtlpEndpoint"];
        }));
});

What's in this package

  • UseLogging(this SyntronyOptions, Action<ISyntronyLoggingBuilder>? configure = null) — the entry point. Calling it more than once on the same SyntronyOptions reuses the same builder, so the calls compose instead of replacing each other's configuration. Calling it without a sink keeps the host's own providers (console, debug, event source); it does still install the default filter rules described in Default output.
  • ISyntronyLoggingBuilder — what sink packages (Syntrony.Logging.Log4Net, Syntrony.Logging.OpenTelemetry) build their Use* extension on top of:
    • Logging (ILoggingBuilder) / Services (IServiceCollection) — the host's logging builder and DI container, for anything a sink needs directly.
    • SetMinimumLevel(LogLevel) — no-ops if the host already has an explicit Logging:LogLevel configuration; this package never overrides what the host already set.
    • WithEnrichment(Action<IDictionary<string, object>>) — accumulates properties a sink applies to every log entry (service name, version, environment). Callbacks run in registration order.
    • RegisterStructuredSink(string) — called by a structured sink (UseLog4Net, eventually UseSerilog) to claim the sink slot. Throws if a different sink already claimed it — they're mutually exclusive, pick one. The first time it is called it removes the host's default providers (console, debug, event source, event log), so every entry is written once, by the sink. Other packages' providers are left alone. Telemetry sinks (UseOpenTelemetry) don't call this; they compose with whichever structured sink is active.
  • GetRegisteredInstance<T>() (internal helper, ServiceCollectionInstanceExtensions) — resolves a singleton the host already registered as an instance (IConfiguration, IHostEnvironment) without building the container, since sink packages need it at registration time, before the app has a built IServiceProvider.

Default output

UseLogging installs these filter rules. They sit first in the rule list, so any rule the host (Logging:LogLevel in appsettings.json) or your code (AddFilter) sets for the same category wins.

Category Default level What it lets through
Microsoft Warning Framework warnings and errors only
Microsoft.AspNetCore Warning No per-request routing, MVC or hosting lines
Microsoft.Hosting.Lifetime Information Now listening on:, environment, content root
Microsoft.EntityFrameworkCore.Database.Command Information Every SQL command EF Core runs, with its duration

The longest matching category wins, so to silence the SQL you need the category itself:

{ "Logging": { "LogLevel": { "Microsoft.EntityFrameworkCore.Database.Command": "Warning" } } }

Microsoft.EntityFrameworkCore: Warning is not enough: it is shorter than the default for the SQL category. Parameter values are printed as @p0='?'; they only appear if you call EnableSensitiveDataLogging(), which you should not do in production.

One entry, one line

With UseLog4Net() the host's console provider is removed, so each entry is written once, in the log4net layout. If you also want the console provider, add it after the sink:

options.UseLogging(log =>
{
    log.UseLog4Net();
    log.Logging.AddConsole();   // after UseLog4Net — before it, it would be removed
});

Settings keyed by provider, such as Logging:Console:LogLevel, no longer apply once the console provider is gone.

No IHostedService involved: the only asynchronous piece — initializing the core's LogHelper once the container is built — runs through SyntronyOptions.AddInitializer, the same deferred-initialization pipeline every other Syntrony package uses.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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 (3)

Showing the top 3 NuGet packages that depend on Syntrony.Logging:

Package Downloads
Syntrony.Logging.Log4Net

Log4Net sink for Syntrony.Logging — parity with Abp.Castle.Log4Net on top of ILogger native.

Syntrony.Web

Exposes Syntrony application services as HTTP endpoints without hand-written controllers: an IApplicationFeatureProvider turns every IApplicationService into a controller and an IApplicationModelConvention derives route, HTTP verb and parameter binding from the method name, replacing ABP's CreateControllersForAppServices.

Syntrony.Logging.OpenTelemetry

Backend-agnostic OpenTelemetry telemetry (logs, traces, metrics) for Syntrony.Logging, via OTLP export.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 46 10/7/2026
1.0.1 124 9/24/2026
1.0.0 102 9/23/2026