SaveApis.Framework

Documentation for SaveApis.Framework

View on GitHub

LoggingInstaller — Web

Key: Logging
Default Enabled:
Package: SaveApis.Framework.Web


Purpose

Replaces all default .NET logging providers with Serilog and configures a formatted ANSI console sink. This ensures structured, readable log output with consistent formatting across all environments.


What It Does


Dependencies

No dependencies on other installers. Runs first in the default execution order.


Configuration

appsettings.json

{
  "Logging": {
    "Default": "Information",
    "Override": {
      "Microsoft.AspNetCore": "Warning",
      "MyNamespace.MyService": "Debug"
    }
  }
}

Environment Variables

Variable Type Default Description
Logging__Default LogEventLevel Information Global minimum log level
Logging__Override__<source> LogEventLevel Override for a specific source namespace

LogEventLevel values: Verbose, Debug, Information, Warning, Error, Fatal

Example:

Logging__Default=Debug
Logging__Override__Microsoft.AspNetCore=Warning
Logging__Override__MyNamespace=Information

InstallerContext Extension

installer.WithLogging(bool enabled = true);

Example — disable in tests:

installer.WithLogging(false);