ArkaSoftware.Extensions.Logger.Abstractions
2.0.0
dotnet add package ArkaSoftware.Extensions.Logger.Abstractions --version 2.0.0
NuGet\Install-Package ArkaSoftware.Extensions.Logger.Abstractions -Version 2.0.0
<PackageReference Include="ArkaSoftware.Extensions.Logger.Abstractions" Version="2.0.0" />
<PackageVersion Include="ArkaSoftware.Extensions.Logger.Abstractions" Version="2.0.0" />
<PackageReference Include="ArkaSoftware.Extensions.Logger.Abstractions" />
paket add ArkaSoftware.Extensions.Logger.Abstractions --version 2.0.0
#r "nuget: ArkaSoftware.Extensions.Logger.Abstractions, 2.0.0"
#:package ArkaSoftware.Extensions.Logger.Abstractions@2.0.0
#addin nuget:?package=ArkaSoftware.Extensions.Logger.Abstractions&version=2.0.0
#tool nuget:?package=ArkaSoftware.Extensions.Logger.Abstractions&version=2.0.0
ArkaSoftware.Extensions.Logger.Abstractions
ArkaSoftware.Extensions.Logger.Abstractions provides a clean and extensible structure for defining logging metadata in .NET applications. It supports both host-level and request-level logging scopes and includes centralized event ID constants for consistent and traceable logging.
🔧 Components
🧱 ArkaSoftwareEventId
Defines a list of common event IDs for various categories of application-level logging.
public class ArkaSoftwareEventId
{
public const int PerformanceMeasurement = 1001;
public const int DomainValidationException = 1010;
public const int CommandValidation = 1011;
public const int QueryValidation = 1012;
public const int EventValidation = 1013;
}
✅ Use these constants for structured and centralized event logging across your application.
🧱 IScopeInformation
Represents information to be included in log scopes, including machine-specific or request-specific data.
public interface IScopeInformation
{
Dictionary<string, string> HostScopeInfo { get; }
Dictionary<string, string> RequestScopeInfo { get; }
}
🧱 ScopeInformation
(Default Implementation)
Default implementation of IScopeInformation that auto-populates useful information such as:
- ✅ Machine name
- 🧠 Entry point assembly
- 🔁 Unique Request ID
public class ScopeInformation : IScopeInformation
{
public ScopeInformation()
{
HostScopeInfo = new Dictionary<string, string>
{
{"MachineName", Environment.MachineName},
{"EntryPoint", Assembly.GetEntryAssembly()!.GetName().Name! }
};
RequestScopeInfo = new Dictionary<string, string>
{
{"RequestId", Guid.NewGuid().ToString()}
};
}
public Dictionary<string, string> HostScopeInfo { get; }
public Dictionary<string, string> RequestScopeInfo { get; }
}
✨ Usage Example
You can inject IScopeInformation into your logging pipeline or middleware:
public class LoggingMiddleware
{
private readonly IScopeInformation _scopeInfo;
public LoggingMiddleware(IScopeInformation scopeInfo)
{
_scopeInfo = scopeInfo;
}
public void LogRequest()
{
foreach (var pair in _scopeInfo.RequestScopeInfo)
{
Console.WriteLine($"{pair.Key}: {pair.Value}");
}
}
}
✅ Benefits
Promotes structured, contextual logging
Enables centralized EventId management
Helps in traceability and diagnostic logging
Decoupled and reusable in any ASP.NET Core or .NET application
🏢 Maintained by
ArkaSoftware
📧 Email Us
🌐 Web Site Visit
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. 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. |
-
net9.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on ArkaSoftware.Extensions.Logger.Abstractions:
| Package | Downloads |
|---|---|
|
Arks.Framework.Endpoints.Web
A library for building robust and standardized web endpoints in .NET applications. Includes base controllers, middleware, filters, and extensions for simplifying API development. |
|
|
Arks.Framework.Utilities.OutService
A multi-purpose library for .NET developers, including utilities for working with Persian dates, strings, and unique ID generation. |
GitHub repositories
This package is not used by any popular GitHub repositories.