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.
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";
});