Jakar.Logging
10.2.0
See the version list below for details.
dotnet add package Jakar.Logging --version 10.2.0
NuGet\Install-Package Jakar.Logging -Version 10.2.0
<PackageReference Include="Jakar.Logging" Version="10.2.0" />
<PackageVersion Include="Jakar.Logging" Version="10.2.0" />
<PackageReference Include="Jakar.Logging" />
paket add Jakar.Logging --version 10.2.0
#r "nuget: Jakar.Logging, 10.2.0"
#:package Jakar.Logging@10.2.0
#addin nuget:?package=Jakar.Logging&version=10.2.0
#tool nuget:?package=Jakar.Logging&version=10.2.0
Jakar.Logging
Serilog and Microsoft.Extensions.Logging support: app logger options, OpenTelemetry activity enrichment, thread and GC properties, screenshots and scopes.
dotnet add package Jakar.Logging
Split out of Jakar.Extensions in 10.12.0. Since 10.2.0 it doesn't depend on Jakar.Extensions or Jakar.Files: only Serilog (and its sinks), Microsoft.Extensions.Logging.Abstractions/Options and System.IO.Hashing. The types are in the Jakar.Extensions namespace. For the Jakar.Extensions integration (AppInformation, DeviceInformation, TelemetrySource), add Jakar.Logging.Serilog.
What's in it
AppLoggerOptions: Serilog configuration for an app: debug and rolling-file sinks,Enrichers, and the folders (AppDataDirectory,CacheDirectory,LogsDirectory,SeqBuffer) and files (LogsFile,ScreenshotFile) as paths.CreateLogger(configure)builds the logger.ActivityEnricher: adds the currentActivity(trace, span, parent, tags, baggage, events), plus the thread and GC state on warnings and above.RuntimeProperties:Thread()/Gc()as Serilog properties (the same shape as Jakar.Extensions'ThreadInformation/GcInfo).Enricher: Serilog property helpers andActivityspan/trace/parent IDs.ScreenShot: attaches a screenshot reference to log events.ScopeProvider,NullScope:IExternalScopeProviderimplementations.
Migrating from 10.1.0
- Add Jakar.Logging.Serilog if you use
LogEventProperties(AppInformation.GetProperty(),DeviceInformation.ToProperty(), ...),DeviceInformationEnricher,OpenTelemetryActivityEnricherorCreateLogger(TelemetrySource); they moved there. AppLoggerOptionsis no longer aBaseClassor disposable, and has noDeviceInfo(pass the device to Jakar.Logging.Serilog'CreateLogger(source, device)).Paths(a Jakar.FilesFilePaths) becameLogsDirectory,LogsFileandScreenshotFile; the directories are strings.ConfigureLoggerno longer takes aTelemetrySource.IOpenTelemetryActivityEnricheris gone;ActivityEnrichertakes theAppLoggerOptions.ScreenShot.Fileis a path;Enricherlost itsAppVersion/GcGenerationInformationoverloads (they're onLogEventPropertiesin Jakar.Logging.Serilog).
Versioning
Versions are <.NET major>.<library major>.<library minor>: a breaking change bumps the middle number (10.1.0 → 10.2.0), anything else the last one.
Repository
| Path | What it is |
|---|---|
Jakar.Logging/ |
The Jakar.Logging package (Serilog only). |
Jakar.Logging.Tests/ |
NUnit tests. |
Jakar.Logging.Serilog/ |
The Jakar.Logging.Serilog package: the Jakar.Extensions integration (see its README). |
Jakar.Logging.Serilog.Tests/ |
NUnit tests. |
.github/workflows/ci.yml |
Build and test on Ubuntu and Windows, for every push and pull request. |
.github/workflows/publish.yml |
On master: CI, then pack both packages and push them to nuget.org (Trusted Publishing). |
| Product | Versions 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. |
-
net10.0
- JetBrains.Annotations (>= 2026.2.0)
- Microsoft.Extensions.Logging.Abstractions (>= 11.0.0)
- Microsoft.Extensions.Options (>= 11.0.0)
- Serilog (>= 4.4.0)
- Serilog.Formatting.Compact (>= 3.0.0)
- Serilog.Sinks.Async (>= 2.1.0)
- Serilog.Sinks.Console (>= 6.1.1)
- Serilog.Sinks.Debug (>= 3.0.0)
- Serilog.Sinks.File (>= 7.0.0)
- System.IO.Hashing (>= 11.0.0)
NuGet packages (7)
Showing the top 5 NuGet packages that depend on Jakar.Logging:
| Package | Downloads |
|---|---|
|
Jakar.Extensions
Extensions to aid in development. |
|
|
Jakar.Database
Package Description |
|
|
Jakar.Files
Files, directories, file watchers, embedded resources, INI configuration and preference files for Jakar.Extensions. |
|
|
Jakar.Users
User, group, role and address models (Guid- and long-keyed), login requests, claims, permissions and JWT parsing. |
|
|
Jakar.Http
An HttpClient-based requester (WebRequester) with retries, typed JSON bodies on Jakar.Json, and WebResponse<T> results that carry their errors. |
GitHub repositories
This package is not used by any popular GitHub repositories.
10.2.0: BREAKING: no longer depends on Jakar.Extensions or Jakar.Files (Serilog, Microsoft.Extensions.Logging.Abstractions/Options and System.IO.Hashing only). The Jakar.Extensions parts moved to the new Jakar.Logging.Serilog: LogEventProperties (AppInformation/ThreadInformation/GcInfo/DeviceInformation properties), DeviceInformationEnricher, OpenTelemetryActivityEnricher (app and device properties from a TelemetrySource) and AppLoggerOptions.CreateLogger(TelemetrySource). Here: ActivityEnricher (spans, plus thread and GC state from RuntimeProperties on warnings) replaces OpenTelemetryActivityEnricher; IOpenTelemetryActivityEnricher is gone. AppLoggerOptions is no longer a BaseClass or disposable, has no DeviceInfo/Info, uses string paths (AppDataDirectory, CacheDirectory, LogsDirectory, SeqBuffer, LogsFile, ScreenshotFile) instead of LocalDirectory/FilePaths, CreateLogger(Action<LoggerConfiguration>?) replaces CreateLogger(TelemetrySource), and ConfigureLogger no longer takes a TelemetrySource; the folder/template constants are on AppLoggerOptions. ScreenShot.File is a path. Enricher lost its AppVersion/GcGenerationInformation overloads. 10.1.0: initial release. Split out of Jakar.Extensions 10.12.0; the types keep the Jakar.Extensions namespace.