Skip to content

Fast.Logging ​

Public members, parameters, returns, and exceptions

Reference source version 3.5.39; targets: net8.0;net9.0;net10.0.

When upgrading code that uses platform flags, see the Runtime H5 migration guide and the dependency history.

Contract and constraints ​

Console formatting and per-level file logging. AddLoggingService(services, configuration, section = "Logging:Fast") binds LoggingSettingsOptions, registers providers and adds a startup filter. File names follow logs/<level><FileFormat>.log. The host owns directory permissions, storage capacity and retention. Installing the package does not prove that file output works. Providers manage console writers and redirected output. Redact sensitive values before passing them to logging APIs; formatters do not guarantee removal of credentials. The examples register logging and use it through application services; they have not been executed as part of this documentation update.

Installation and examples ​

Install the package ​

bash
dotnet add package Fast.Logging

Example 1 ​

csharp
using Fast.Logging;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.AspNetCore.Builder;

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddLoggingService(builder.Configuration);

var app = builder.Build();
app.Logger.LogInformation("Application configured");
app.MapGet("/health", () => "healthy");
app.Run();

public sealed class Worker(ILogger<Worker> logger)
{
    public void Report(int count) => logger.LogInformation("Processed {Count} items", count);
}

Web-host examples belong in a consumer project using Microsoft.NET.Sdk.Web and a supported .NET target. IaaS examples can be used in an ordinary class library. Registration precedes builder.Build(); configure middleware and endpoints before app.Run(). Samples retain their original code and comments. No host, external service, database operation or client generator was run, and these snippets have not been compiled in this update.

Source reference ​

Changes in this version ​

Since Fast.Logging 3.5.34, the package uses standard null-argument helpers for formatter and logger. Null still throws ArgumentNullException with the same parameter name. This batch does not change the logging output protocol, file format or provider pipeline.

Dependency alignment on 2026-11-02 ​

2026-11-02 dependency alignment: this package increments from 3.5.38 to 3.5.39, updating its dependency to Fast.Runtime 3.5.37. This module's implementation and public declarations are unchanged. Runtime adds mobile H5 and shifts Android and subsequent flags; migrate numeric protocols/masks, rebuild consumers and regenerate client enums. See the Runtime H5 migration guide.

2026-10-24 versions and dependencies ​

On 2026-10-24, this package increments from 3.5.35 to 3.5.36, with dependencies updated to Fast.Runtime 3.5.34. This module's own implementation and public declarations are unchanged.

Consumers using AppEnvironmentEnum must migrate numeric values and rebuild according to the Runtime HarmonyOS migration guide. This batch reviewed source and effective MSBuild package metadata only. Tests were skipped as requested; no restore, build, pack or consumer runtime validation was performed.