Changelog
All notable changes to ArturRios.Logging are recorded in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased
2.0.1 - 2026-10-29
Changed
StandaloneLogger.Exceptionlogs the exception’sToString()— type, message, inner exceptions and stack trace — asStateLogger.Exceptionalready did, instead of only its message.StandaloneLogger.ExceptionandStateLogger.ExceptionthrowArgumentNullExceptionfor a null exception instead of aNullReferenceException.- The
StandaloneLoggerandStateLoggerconstructors throwArgumentNullExceptionfor a null configuration list instead of aNullReferenceException. - The package’s project URL is the documentation site’s new address,
https://docs.artur-rios.tech/dotnet-logging, since the site moved from GitHub Pages.
Fixed
MicrosoftLoggerAdapterputs the resolvedIStateLogger’s ownTraceIdback after forwarding an entry, and sets, uses and restores it under a lock on that instance. With a singletonIStateLogger, concurrent entries could be written with each other’s trace id, and an entry with no ambient id inherited the id of the previous one.FileLoggerstamps an entry and chooses its file from the same instant, so an entry written across the turn of an hour, day, month or year no longer lands in the previous period’s file with the next period’s timestamp.AddCustomLoggerregisters its provider once however many times it is called; a second call registered a second provider, and every entry was written twice.
2.0.0 - 2026-08-24
See Upgrading from 1.x to 2.0 for the one case that needs a code change.
Changed
- Breaking:
MicrosoftLoggerAdapter.TraceIdreturns an explicitly set id, else the trace id ofActivity.Current, instead of readingHttpContext.Items["TraceId"]. Setting it holds the value in anAsyncLocalfor the current execution context rather than writing intoHttpContext.Items. Code behindArturRios.Util.WebApi’sTraceActivityMiddlewarelogs the same id as before. MicrosoftLoggerAdapter.Logpasses that same ambient trace id to the resolvedIStateLogger.FileLoggerreports an unknown folder scheme with the parameter name, the offending value and a message.ArturRios.Extensionsupdated from 1.3.0 to 1.4.0 andArturRios.Utilfrom 2.0.0 to 2.1.0.
Removed
- Breaking: the
Microsoft.AspNetCore.Httpdependency, so the package is usable from a console app or a worker without pulling in an ASP.NET Core 2.x compatibility package.IHttpContextAccessorno longer needs to be registered.
Fixed
- Entries logged through
MicrosoftLoggerAdapterwithout caller information are attributed to the calling code rather than to the logger itself. LogFolderScheme.ByRequestgroups a logger’s entries in one folder instead of creating a folder per entry.MicrosoftLoggerAdapter,ConsoleLoggerandFileLoggercarry XML documentation, so consuming projects that generate documentation build without CS1591 warnings.
Upgrading from 1.x to 2.0
Microsoft.AspNetCore.Http is gone. The package no longer depends on it, so ArturRios.Logging is
now usable from a console app or a worker without dragging in an ASP.NET Core 2.x compatibility package
and its transitive closure.
MicrosoftLoggerAdapter.TraceId reads the ambient Activity instead of HttpContext.Items["TraceId"].
For anything running behind ArturRios.Util.WebApi’s TraceActivityMiddleware, nothing changes: that
middleware starts a W3C activity per request and sets HttpContext.Items["TraceId"] to
activity.TraceId.ToString(), so the value read from the activity is the same string that used to be read
from the items dictionary.
Two cases do change:
- Code that wrote
HttpContext.Items["TraceId"]by hand, without an activity, is no longer seen. Start an activity, or assignadapter.TraceIddirectly. - Setting
adapter.TraceIdno longer writes intoHttpContext.Items. It sets anAsyncLocalthat this library reads; anything else reading that dictionary entry must be given the value explicitly.
IHttpContextAccessor no longer needs to be registered for correlation to work, and registering it has no
effect on this library.
1.1.0 - 2026-08-19
Changed
ArturRios.Extensionsupdated from 1.0.2 to 1.3.0 andArturRios.Utilfrom 1.1.0 to 2.0.0, so consumers no longer resolve outdated transitive dependencies.Microsoft.Extensions.Logging.Abstractionsupdated from 10.0.1 to 10.0.11, which the newerArturRios.Utilrequires.
1.0.0 - 2025-12-21
Added
ConsoleLoggerwith ANSI color-coded output andFileLoggerwith configurable folder schemes and log splitting.- Automatic caller information capture, trace id support and custom log levels.
StandaloneLoggerandStateLoggerto use the loggers on their own or as part of a logging state.MicrosoftLoggerAdapterandMicrosoftLoggerProviderto plug the loggers intoMicrosoft.Extensions.Logging.