Documentation / .NET

Integrate a .NET app with Logister.

The recommended path for ASP.NET Core projects is Logister.AspNetCore. It captures uncaught request exceptions, optional request transactions and spans, runtime metadata, structured .NET exception chains, and custom metrics you choose from your own C# services.

Before you start

Create the project with the .NET / ASP.NET Core integration type.

What you needWhy it matters
Project API tokenAuthenticates the app when sending events
Logister instance base URLUsed to build the ingest, check-in, and deployment endpoints
.NET 8+ appLets you use the first Logister .NET SDK packages
Optional GitHub App installationLets Logister use Repository, CommitSha, Branch, and deployment records for source excerpts and deploy links

What you get

Use the .NET integration to make ASP.NET Core failures and deploys easier to act on.

NeedWhat appears in Logister
Catch uncaught request exceptionsInbox issues with .NET exception details, stack frames, request URL, request ID, trace ID, user ID, framework metadata, and runtime metadata.
Understand failed ASP.NET requestsA .NET-focused detail view with stack, query, optional cookies, headers, routing, runtime, inner exceptions, and exception data when captured.
Track request latencyRequest transaction events and optional request spans that power project performance and request load waterfall charts.
Monitor workers and business signalsMetrics, logs, custom transactions, spans, and check-ins from injected LogisterClient calls.
Resolve source and deploy historyRepository, CommitSha, Branch, release, and deployment records that let Logister show source excerpts, GitHub links, and "started after deploy" context when a GitHub repository is connected to the project.
Connect traces and logsRelease, request ID, trace ID, session ID, and user ID context that helps Logister show release health and related logs.

Install

Install the base client or ASP.NET Core package from NuGet.

Use the published NuGet packages when you want a .NET service to send errors, logs, metrics, transactions, spans, and check-ins into Logister. The NuGet listings are the canonical package pages for install commands, version history, and package metadata.

shell
dotnet add package Logister
dotnet add package Logister.AspNetCore

Package links: NuGet Logister, NuGet Logister.AspNetCore, and GitHub. For local development, forks, or unreleased SDK changes, reference the project from that repo directly.

xml
<ProjectReference Include="../logister-dotnet/src/Logister/Logister.csproj" />
<ProjectReference Include="../logister-dotnet/src/Logister.AspNetCore/Logister.AspNetCore.csproj" />

ASP.NET Core

Capture uncaught exceptions and optional request transactions.

csharp
using Logister.AspNetCore;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddLogister(builder.Configuration, options =>
{
    options.Client.DefaultContext["service"] = "quriatime-web";
    options.Client.Repository = "acme/timesheets";
    options.Client.CommitSha = Environment.GetEnvironmentVariable("GITHUB_SHA");
    options.Client.Branch = Environment.GetEnvironmentVariable("GITHUB_REF_NAME");
    options.CaptureRequestSpans = true;
});

var app = builder.Build();

app.UseLogisterExceptionReporting();
app.UseLogisterRequestTransactions();

The exception middleware captures structured .NET exception details, stack frames when available, inner exceptions, Exception.Data, request URL, request ID, trace ID, user ID, framework metadata, and runtime metadata. Request transactions record total request duration; request spans add the root server timing used by request load waterfall charts.

Custom events

Use the injected client for metrics and events you choose.

csharp
public sealed class ApprovalService(LogisterClient logister)
{
    public async Task RecordQueueDepthAsync(int pending)
    {
        await logister.CaptureMetricAsync(
            "timesheet.approvals.pending",
            pending,
            new MetricOptions { Unit = "count" });

        await logister.CaptureSpanAsync(
            "approval queue db load",
            42.6,
            new SpanOptions
            {
                Kind = "db",
                Status = "ok",
                TraceId = "trace-123",
                ParentSpanId = "span-root",
                Context = new Dictionary<string, object?>
                {
                    ["queue"] = "approvals"
                }
            });

        await logister.CheckInAsync(
            "nightly-import",
            "ok",
            new CheckInOptions
            {
                Release = "worker@2026.05.21",
                ExpectedIntervalSeconds = 3600,
                DurationMs = 122.5,
                TraceId = "trace-123",
                RequestId = "req-123"
            });
    }
}

The same client supports CaptureExceptionAsync(), CaptureMessageAsync(), CaptureMetricAsync(), CaptureTransactionAsync(), CaptureSpanAsync(), CheckInAsync(), and RecordDeploymentAsync(). Capture options support per-event environment, release, trace ID, request ID, session ID, and user ID fields; span options add span ID, parent span ID, kind, status, and start/end timestamps; check-ins also send top-level release and monitor timing metadata to match the HTTP API.

Source and deployments

Set source context once, then record each deployed commit.

If the project is connected to the GitHub App, Logister can use source context to resolve .NET stack frames to repository files. Deployment records map a release and environment to the exact commit shipped by CI/CD.

csharp
await client.RecordDeploymentAsync(new DeploymentOptions
{
    Release = "timesheets@2026.06.18",
    Environment = "production",
    Repository = "acme/timesheets",
    CommitSha = "4f8c2d1a9b7e6c5d4a3b2c1d0e9f8a7b6c5d4e3f",
    Branch = "main",
    DeployedAt = DateTimeOffset.UtcNow,
    ReleaseTag = "v2026.06.18",
    WorkflowRunUrl = "https://github.com/acme/timesheets/actions/runs/123"
});
FieldSet it fromUsed for
RepositoryLOGISTER_REPOSITORY or GITHUB_REPOSITORYFinds the GitHub repository connected to the project.
CommitShaLOGISTER_COMMIT_SHA or GITHUB_SHAResolves stack frames and deployment context to the exact commit.
BranchLOGISTER_BRANCH or GITHUB_REF_NAMEFalls back when an event has no commit or deployment record yet.
ReleaseYour app version, build ID, tag, or package versionConnects event filters, release health, and deployments.

Verify it

After a deploy, send one test exception with the same Release. Open the event detail and check for source lookup status, deployment context, and GitHub links. If source is missing, confirm the GitHub App is installed, linked to the project, and the repository is connected; then check that the event has repository plus either commit_sha or a matching deployment record.

Configuration

Configure with appsettings or environment variables.

json
{
  "Logister": {
    "ApiKey": "your-project-api-token",
    "BaseUrl": "https://your-logister-host.example",
    "Environment": "production",
    "Release": "quriatime@2026.06.18",
    "Repository": "acme/quriatime",
    "CommitSha": "4f8c2d1a9b7e6c5d4a3b2c1d0e9f8a7b6c5d4e3f",
    "Branch": "main",
    "CaptureRequestTransactions": true,
    "CaptureRequestSpans": true
  }
}

The base client also reads LOGISTER_API_KEY, LOGISTER_BASE_URL, LOGISTER_ENVIRONMENT, LOGISTER_RELEASE, LOGISTER_REPOSITORY, LOGISTER_COMMIT_SHA, LOGISTER_BRANCH, and LOGISTER_TIMEOUT. In GitHub Actions it falls back to GITHUB_REPOSITORY, GITHUB_SHA, and GITHUB_REF_NAME when the Logister-specific source variables are not set.