Production guide

ArgusLogs best practices

Keep log volume under control, query efficiently, and prefer TieredStorage with SQLite for a compact hot tier — plus security and retention advice for production.

Section 3 of 8 Storage & performance

Prefer TieredStorage

ArgusLogs.TieredStorage writes structured records to a SQLite hot database while rolling cold batches to Snappy-compressed Parquet. Compared to append-only JSONL, indexed columns (timestamp, level, traceId, userId) stay queryable without scanning the whole file.

Recommended storage tiers

  1. ApplicationArgusLogs.core emits structured telemetry at method, SQL, and HTTP boundaries.
  2. Hot tier (SQLite)Recent records in LogRecords — fast filters for the embedded UI and ad-hoc diagnostics.
  3. Cold tier (Parquet)Partitioned archives after RetentionDays — compact long-term storage for analytics jobs.
  • SQLite keeps the working set small; vacuum and batch inserts avoid unbounded WAL growth.
  • Parquet + Snappy dramatically reduces disk versus pretty-printed JSON lines.
  • Dedicated UserId column (plus MetadataJson) enables indexed lookups without parsing every row.
  • TieredStorage migrates older SQLite schemas automatically — UserId is added if missing.

Enable in AddArgus

Call WithTieredStorage inside AddArgus so sinks register with the same license and options discovery as the core package.

Program.cs
builder.Services.AddArgus(options =>
{
    options.WithTieredStorage(tiered =>
    {
        tiered.Enabled = true;
        tiered.SqliteConnectionString = "Data Source=logs/tiered/argus_hot.db;Cache=Shared";
        tiered.ArchiveDirectory = "logs/tiered/archives";
        tiered.RetentionDays = 7;
        tiered.BatchSize = 10_000;
        tiered.CompressionMethod = "Snappy";
    });
});

NuGet package

Install ArgusLogs.TieredStorage alongside ArgusLogs and ArgusLogs.UI for the full embedded diagnostics stack.

Terminal
dotnet add package ArgusLogs.TieredStorage --version 1.0.11-alpha.2608292142