Developer guide

Embedded log viewer & tiered storage

Mount ArgusLogs.UI at /argus-logs, stream SQLite hot-tier records, and inspect traces with KQL — no external dashboard required.

Tutorials are hands-on walkthroughs (prerequisites, install, configuration, code, expected result, explanation, then next steps). Official reference stays in documentation — this is not a full docs clone.

Section 3 of 5 Embedded UI

Wire Program.cs

Registration happens in two places: services (AddArgus + tiered storage options) and the HTTP pipeline (UseArgus then UseArgusUI).

Program.cs pattern

WithTieredStorage disables flat file logging and registers the SQLite sink. Enable network user tracking so the User ID column is populated in the UI.

Program.cs
using ArgusLogs;
using ArgusLogs.UI;

var storageDir = Path.Combine(builder.Environment.ContentRootPath, "logs", "tiered");
Directory.CreateDirectory(storageDir);

builder.Services.AddArgus(options =>
{
    options.SetLicense(builder.Configuration["ArgusLogsKey"] ?? "")
        .WithTieredStorage(opt =>
        {
            opt.SqliteConnectionString = $"Data Source={Path.Combine(storageDir, "argus_hot.db")};Cache=Shared";
            opt.ArchiveDirectory = Path.Combine(storageDir, "archives");
            opt.RetentionDays = 7;
            opt.BatchSize = 10_000;
            opt.CompressionMethod = "Snappy";
            opt.EnableIncrementalVacuum = true;
        })
        .WithNetworkTracking(net =>
        {
            net.User.Enabled = true;
            net.User.LogUserId = true;
        });
});

var app = builder.Build();

app.UseArgus();
app.UseArgusUI(options =>
{
    options.RoutePrefix = "/argus-logs";
    options.DocumentTitle = "My App — Argus Diagnostics";
});