Albatross.Logging
10.0.3
Prefix Reserved
dotnet add package Albatross.Logging --version 10.0.3
NuGet\Install-Package Albatross.Logging -Version 10.0.3
<PackageReference Include="Albatross.Logging" Version="10.0.3" />
<PackageVersion Include="Albatross.Logging" Version="10.0.3" />
<PackageReference Include="Albatross.Logging" />
paket add Albatross.Logging --version 10.0.3
#r "nuget: Albatross.Logging, 10.0.3"
#:package Albatross.Logging@10.0.3
#addin nuget:?package=Albatross.Logging&version=10.0.3
#tool nuget:?package=Albatross.Logging&version=10.0.3
Albatross.Logging
Albatross.Logging is a .NET library that provides quick and easy logging setup for .NET applications using Serilog. It offers a fluent builder pattern for configuring Serilog with support for file-based configuration, console output, and various sinks. The library targets .NET Standard 2.0, making it compatible with .NET Framework 4.6.1+ and .NET Core/.NET 5+.
Features
- Fluent Configuration API - Simple builder pattern via
SetupSerilogclass for configuring Serilog - File-Based Configuration - Load Serilog settings from
serilog.jsonwith environment-specific overrides - Console Sink with Dynamic Level Control - Built-in console sink with runtime log level switching
- ErrorMessage Enricher - Display exception messages inline with log entries for quick error identification
- Shortened Logger Name - Reduce verbose namespace-based logger names for cleaner output
- Enhanced SlackSink - Improved Slack integration with flexible webhook URL configuration
Quick Start
Install the package:
dotnet add package Albatross.Logging
Basic setup with code configuration:
var logger = new SetupSerilog()
.UseConsole(LogEventLevel.Information)
.Create();
Setup with file-based configuration (serilog.json):
var logger = new SetupSerilog()
.UseConfigFile(environment, basePath, args, optional: true)
.UseConsole(LogEventLevel.Information)
.Create();
Integrate with Microsoft.Extensions.Hosting:
var builder = Host.CreateDefaultBuilder();
builder.UseSerilog();
builder.ConfigureLogging((context, logging) => {
new SetupSerilog()
.UseConfigFile(environment, null, null, true)
.UseConsole(LogEventLevel.Information)
.Create();
});
Sample serilog.json:
{
"Serilog": {
"MinimumLevel": {
"Default": "Debug",
"Override": {
"System": "Information",
"Microsoft": "Information"
}
},
"WriteTo": [
{
"Name": "File",
"Args": {
"path": "log\\log.txt",
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ssz} [{Level:w3}] ({ThreadId}) {SourceContext} {Message:lj}{NewLine}{Exception}",
"rollingInterval": "Day"
}
}
],
"Enrich": [ "FromLogContext", "WithThreadId" ]
}
}
Code Repo
https://github.com/RushuiGuan/logging
Documentation
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Extensions.Configuration (>= 10.0.1)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.1)
- Microsoft.Extensions.Configuration.FileExtensions (>= 10.0.1)
- Microsoft.Extensions.Configuration.Json (>= 10.0.1)
- Microsoft.Extensions.Logging (>= 10.0.1)
- Serilog (>= 4.3.0)
- Serilog.Enrichers.Environment (>= 3.0.1)
- Serilog.Enrichers.Thread (>= 4.0.0)
- Serilog.Expressions (>= 5.0.0)
- Serilog.Extensions.Hosting (>= 10.0.0)
- Serilog.Settings.Configuration (>= 10.0.0)
- Serilog.Sinks.Console (>= 6.1.1)
- Serilog.Sinks.File (>= 7.0.0)
- Serilog.Sinks.Slack (>= 2.2.3)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Albatross.Logging:
| Package | Downloads |
|---|---|
|
Albatross.Hosting
A library for creating .Net Web Api or Service applications with preconfigured settings |
|
|
Albatross.CommandLine.Defaults
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.3 | 53 | 1/26/2026 |
| 10.0.2 | 36 | 1/23/2026 |
| 10.0.1 | 201 | 11/30/2025 |
| 10.0.0-13.main | 54 | 11/27/2025 |
| 10.0.0-11.main | 66 | 11/12/2025 |
| 9.0.0 | 100 | 7/15/2025 |
| 8.0.1 | 264 | 2/27/2025 |
| 8.0.0 | 152 | 11/22/2024 |
| 7.5.7 | 145 | 11/11/2024 |
| 7.5.6 | 103 | 11/8/2024 |
| 7.5.5 | 94 | 11/7/2024 |
| 7.5.4 | 85 | 11/7/2024 |
| 7.4.2 | 126 | 10/8/2024 |
| 7.4.1 | 99 | 10/5/2024 |
| 6.1.1 | 439 | 9/18/2023 |
| 4.0.2 | 1,029 | 10/18/2022 |
| 2.8.0 | 1,845 | 8/11/2021 |
| 2.3.6 | 1,062 | 2/23/2021 |
| 1.6.7 | 4,601 | 9/24/2020 |
| 1.6.6 | 2,822 | 8/21/2020 |
| 1.6.5 | 1,541 | 7/30/2020 |
| 1.6.4 | 906 | 7/30/2020 |
| 1.6.3 | 1,184 | 7/29/2020 |
| 1.6.1 | 926 | 7/27/2020 |
| 1.6.0 | 1,160 | 7/12/2020 |
| 1.5.33 | 1,417 | 7/9/2020 |