SeliseBlocks.LMT.Client
9.0.3
dotnet add package SeliseBlocks.LMT.Client --version 9.0.3
NuGet\Install-Package SeliseBlocks.LMT.Client -Version 9.0.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SeliseBlocks.LMT.Client" Version="9.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SeliseBlocks.LMT.Client" Version="9.0.3" />
<PackageReference Include="SeliseBlocks.LMT.Client" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SeliseBlocks.LMT.Client --version 9.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SeliseBlocks.LMT.Client, 9.0.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SeliseBlocks.LMT.Client@9.0.3
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SeliseBlocks.LMT.Client&version=9.0.3
#tool nuget:?package=SeliseBlocks.LMT.Client&version=9.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
SeliseBlocks.LMT.Client
A robust and high-performance .NET client library for logging and distributed tracing with Azure Service Bus integration. Designed for enterprise applications requiring centralized log and trace management with built-in resilience, batching, and automatic retry mechanisms.
β¨ Features
- π High Performance - Automatic batching reduces network overhead and improves throughput
- π Automatic Retry Logic - Exponential backoff with configurable retry attempts
- πΎ Failed Batch Queue - Prevents data loss during transient failures
- π§΅ Thread-Safe - Built with concurrent collections for multi-threaded environments
- π OpenTelemetry Integration - Industry-standard distributed tracing support
- π’ Multi-Tenant Support - Automatic tenant isolation via baggage propagation
- β‘ Zero Dependencies on Logging Frameworks - Works independently or alongside Serilog, NLog, etc.
- π― Azure Service Bus Native - Optimized for Azure Service Bus Topics and Subscriptions
- π Easy Integration - Simple dependency injection setup with minimal configuration
ποΈ Architecture
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Your Application β
β ββββββββββββββββ ββββββββββββββββββββββββ β
β β IBlocksLoggerβ β OpenTelemetry β β
β β (Logs) β β (Traces) β β
β ββββββββ¬ββββββββ ββββββββββββ¬ββββββββββββ β
β β β β
β β Batching & Retry β Batching & Retry β
β βΌ βΌ β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Azure Service Bus β β
β ββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββ
β LMT Service Worker β
β (Subscriptions) β
βββββββββββββ¬ββββββββββββ
β
βΌ
βββββββββββββββββββββββββ
β MongoDB Storage β
β β’ Logs by Service β
β β’ Traces by Tenant β
βββββββββββββββββββββββββ
π¦ Installation
Install via NuGet Package Manager:
dotnet add package SeliseBlocks.LMT.Client
Or via Package Manager Console:
Install-Package SeliseBlocks.LMT.Client
π Quick Start
1. Add to your appsettings.Development.json:
{
"Lmt": {
"ServiceId": "your-service-id",
"ConnectionString": "Endpoint=sb://your-namespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=your-key",
"XBlocksKey": "your-XBlocksKey",
"LogBatchSize": 100,
"TraceBatchSize": 1000,
"FlushIntervalSeconds": 5,
"MaxRetries": 3,
"MaxFailedBatches": 100,
"EnableLogging": true,
"EnableTracing": true
}
}
2. Register services in Program.cs or Startup.cs:
// Add LMT Client
builder.Services.AddLmtClient(builder.Configuration);
// Add OpenTelemetry for distributed tracing
builder.Services.AddSingleton(new ActivitySource("your-serviceId"));
builder.Services.AddOpenTelemetry()
.WithTracing(tracerBuilder =>
{
tracerBuilder
.AddSource("your-serviceId") // Match your ServiceId
.AddAspNetCoreInstrumentation()
.AddHttpClientInstrumentation()
.AddLmtTracing(builder.Services.BuildServiceProvider()
.GetRequiredService<LmtOptions>());
});
3. Demo code:
public class Test
{
private readonly IBlocksLogger _logger;
private readonly ActivitySource _activitySource;
public Test(IBlocksLogger logger, ActivitySource activitySource)
{
_logger = logger;
_activitySource = activitySource;
}
public string LogTest()
{
using var activity = _activitySource.StartActivity("LogTest");
_logger.LogInformation("LogTest method call");
return "Test successful";
}
}
βοΈ Configuration
Configuration Options
| Property | Type | Default | Description | |
|---|---|---|---|---|
ServiceId |
string |
required | Unique identifier for your service | |
ConnectionString |
string |
required | Azure Service Bus connection string | |
XBlocksKey |
string |
required | Selise blocks cloud key | |
LogBatchSize |
int |
100 |
Number of logs to batch before sending | |
TraceBatchSize |
int |
1000 |
Number of traces to batch before sending | |
FlushIntervalSeconds |
int |
5 |
Interval to flush batches automatically | |
MaxRetries |
int |
3 |
Maximum retry attempts for failed sends | |
MaxFailedBatches |
int |
100 |
Maximum failed batches to queue | |
EnableLogging |
bool |
true |
Enable/disable logging | |
EnableTracing |
bool |
true |
Enable/disable tracing |
Log Levels
// Trace - Most detailed information
_logger.LogTrace("Entering method ProcessPayment");
// Debug - Debugging information
_logger.LogDebug("Payment gateway response received");
// Information - General flow
_logger.LogInformation("Payment processed successfully {dateTime}", DateTimeOffset.UtcNow);
// Warning - Unexpected but handled situations
_logger.LogWarning("Payment took longer than expected");
// Error - Errors and exceptions
_logger.LogError("Payment failed", exception);
// Critical - Critical failures
_logger.LogCritical("Payment gateway is down", exception);
IBlocksLogger Interface
public interface IBlocksLogger
{
void Log(LmtLogLevel level, string message, Exception exception = null, params object?[] args);
void LogTrace(string message, params object?[] args );
void LogDebug(string message, params object?[] args);
void LogInformation(string message, params object?[] args);
void LogWarning(string message, params object?[] args);
void LogError(string messageTemplate, Exception? exception = null, params object?[] args);
void LogCritical(string message, Exception exception = null, params object?[] args);
}
LmtLogLevel Enum
public enum LmtLogLevel
{
Trace = 0, // Most detailed
Debug = 1, // Debug information
Information = 2, // General flow
Warning = 3, // Unexpected situations
Error = 4, // Errors and exceptions
Critical = 5 // Critical failures
}
π License
This project is licensed under the MIT License - see the LICENSE file for details.
| 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- Azure.Messaging.ServiceBus (>= 7.20.1)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.9)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.9)
- OpenTelemetry (>= 1.13.1)
- OpenTelemetry.Api (>= 1.13.1)
- OpenTelemetry.Extensions.Hosting (>= 1.13.1)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.12.0)
- OpenTelemetry.Instrumentation.Http (>= 1.12.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on SeliseBlocks.LMT.Client:
| Package | Downloads |
|---|---|
|
SeliseBlocks.Genesis
Blocks Genesis |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 9.0.3 | 1,203 | 10/27/2025 |
| 9.0.2 | 231 | 10/23/2025 |
| 9.0.1 | 238 | 10/15/2025 |
| 1.0.10 | 178 | 10/15/2025 |
| 1.0.9 | 173 | 10/15/2025 |
| 1.0.8 | 200 | 10/15/2025 |
| 1.0.7 | 185 | 10/14/2025 |
| 1.0.6 | 179 | 10/14/2025 |
| 1.0.5 | 185 | 10/14/2025 |
| 1.0.3 | 185 | 10/11/2025 |
| 1.0.2 | 148 | 10/11/2025 |
| 1.0.1 | 99 | 10/11/2025 |
| 1.0.0 | 197 | 10/9/2025 |