konso-clients-logs-dotnet

0
месяц назад
месяц назад
24 дня назад
месяц назад
месяц назад
месяц назад
месяц назад
README.md

Konso Logging .NET Client

The Konso Logging .NET Client Library simplifies capturing and centralizing logs from .NET applications. Logs are shipped to the Konso platform via your choice of transport.

Features

  • Flexible transport: choose REST, gRPC, or their async (non-blocking) variants
  • Plug-and-play: integrates with the standard
    ILogger<T>
    abstraction — no changes to your existing logging calls
  • Centralized logs: search, filter, and analyze logs from all your services in one place
  • Configurable log levels: ship only the severity you care about

Documentation

Konso API reference

Requirements

  • .NET 10 or higher
  • A Konso account with a created bucket (BucketId + API key)

Installation

NuGet\Install-Package Konso.Clients.Logs

Transport types

ValueDescription
Rest
Synchronous HTTP/JSON — log call blocks until the request completes
Grpc
Synchronous gRPC — log call blocks until the request completes
AsyncRest
Non-blocking HTTP/JSON — logs are enqueued and sent in the background
AsyncGrpc
Non-blocking gRPC — logs are enqueued and sent in the background

The async variants use an in-memory queue and a background

IHostedService
(
KonsoLogsProcessorService
) to drain it. They are recommended for latency-sensitive applications.

Getting Started

REST transport

Add to

appsettings.json
:

Register in

Program.cs
:

gRPC transport

Add to

appsettings.json
:

Register in

Program.cs
:

Async REST transport

Same configuration as REST, with

"Transport": "AsyncRest"
. The async transport requires the hosted services infrastructure — ensure your app calls
builder.Services.AddHostedService
or uses
WebApplication
/
IHost
which registers hosted services automatically.

Async gRPC transport

The

Transport
value drives which provider is used — no code changes needed when switching transports.

Inline configuration (alternative)

If you prefer not to use

appsettings.json
, you can configure inline:

Correlation ID support (optional)

To automatically propagate correlation IDs from HTTP request headers or sessions, register

IHttpContextAccessor
:

Logging usage

No changes needed to your existing code — use the standard

ILogger<T>
:

Support

For questions or issues please contact support@konso.io or open a GitHub issue.