SolTechnology.Core.Logging
0.2.1
See the version list below for details.
dotnet add package SolTechnology.Core.Logging --version 0.2.1
NuGet\Install-Package SolTechnology.Core.Logging -Version 0.2.1
<PackageReference Include="SolTechnology.Core.Logging" Version="0.2.1" />
<PackageVersion Include="SolTechnology.Core.Logging" Version="0.2.1" />
<PackageReference Include="SolTechnology.Core.Logging" />
paket add SolTechnology.Core.Logging --version 0.2.1
#r "nuget: SolTechnology.Core.Logging, 0.2.1"
#:package SolTechnology.Core.Logging@0.2.1
#addin nuget:?package=SolTechnology.Core.Logging&version=0.2.1
#tool nuget:?package=SolTechnology.Core.Logging&version=0.2.1
Overview
The SolTechnology.Core.Logging library provides set of Ilogger extensions working well with Application Insights.
Registration
For installing the library, reference SolTechnology.Core.Logging nuget package.
Configuration
No extra configuration is needed.
Usage
- Add app insights logging
builder.Services.AddLogging(c =>
c.AddConsole()
.AddApplicationInsights());
appsettings:
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Information",
"Microsoft": "Information",
"Microsoft.Hosting.Lifetime": "Information"
},
"Debug": {
"LogLevel": {
"Default": "Trace",
"Microsoft.Hosting": "Trace",
"Microsoft": "Trace",
"Microsoft.Hosting.Lifetime": "Trace"
}
},
"ApplicationInsights": {
"sampling": {
"isEnabled": true,
"maxTelemetryItemsPerSecond": 100
},
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Information",
"Microsoft": "Information",
"Microsoft.Hosting.Lifetime": "Information"
}
}
}
- Begin operation scope (creates a custom dimension - key useful for App Insights tracking)
using (_logger.BeginOperationScope(new KeyValuePair<string, object>(command.LogScope.OperationIdName, command.LogScope.OperationId)))
- Log operation (action, method, execution) started status
_logger.OperationStarted(command.LogScope.OperationName);
- Log operation succeeded or failed status
_logger.OperationSucceeded(command.LogScope.OperationName);
_logger.OperationFailed(command.LogScope.OperationName, e);
- Example result
| Timestamp | Message | CustomDimensions.PlayerId |
|---|---|---|
| 4/11/2022, 12:00:10.738 AM | Operation: [CalculatePlayerStatistics]. Status: [START] | 44 |
| 4/11/2022, 12:00:12.859 AM | Operation: [CalculatePlayerStatistics]. Status: [SUCCESS] | 44 |
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. 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. |
-
net6.0
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on SolTechnology.Core.Logging:
| Package | Downloads |
|---|---|
|
SolTechnology.Core.CQRS
Complete CQRS implementation built on MediatR with Result pattern, SuperChain for complex workflows, automatic FluentValidation, and logging pipeline behaviors. Enforces clean separation between reads and writes with explicit success/failure handling. |
GitHub repositories
This package is not used by any popular GitHub repositories.