MindAttic/MindAttic.Log
Library

MindAttic.Log.

Logs you can query, without running a log server.

MindAttic.Log is the one logging pipeline for every MindAttic app: keep calling ILogger<T>, and every entry lands in a strict, indexed schema in the app's own SQLite file or a shared SQL Server database, with a desktop Reader to browse them all.

Active C# .NET 9 .NET 10 Serilog SQLite SQL Server WPF WebView2

What it is

One schema for every app's logs

Most apps already call ILogger<T>, yet the output goes nowhere, or into ad hoc text files nobody can filter. MindAttic.Log becomes the sink underneath. Add one AddMindAtticLog call at startup and every existing logging call starts writing durable, structured rows. No call site changes.

Each entry is written to the same strict schema, timestamp, level, application, category, message and template, exception, structured properties, correlation id and machine, so a query written against one app's logs works unchanged against any other's.

By default every app gets its own standalone MindAttic.Log.db SQLite file under MindAttic.Vault's shared roaming root, kept apart from the app's cache and data so clearing them can never take the logs along. It runs in WAL mode so the Reader can query a file live while the app keeps writing. Apps that prefer a server point a connection string at one shared SQL Server MindAttic.Log database instead.

And a log write never takes the host down: every sink swallows its own storage failures rather than letting a full disk or a locked file reach application code that was only trying to record a warning.

Who it's for

  • .NET app developersGet durable, queryable logs from the ILogger<T> calls you already have, with one line of setup.
  • Anyone debugging a desktop appOpen the Reader, pick the app, and filter its history by date, level, category or text.
  • Teams running many small appsOne schema everywhere, so tooling and queries written once work against every app.

Features

What you get

01

No call-site changes

services.AddMindAtticLog(...) wires a batched Serilog pipeline beneath ILogger<T>; apps delete their ad hoc writers, not their logging calls.

02

One strict schema

LogEntry and LogSchema define the exact columns every store holds, from TimestampUtc and Level to PropertiesJson and CorrelationId.

03

SQLite by default

One standalone MindAttic.Log.db per app, real indexes and real WHERE clauses, and no server to run.

04

Or a shared SQL Server

Set a connection string and the app writes to the shared MindAttic.Log database, created on first write and told apart by the Application column.

05

Live-readable

The SQLite sink runs in WAL mode so the Reader can query a log while its app is still writing to it.

06

Never throws into your app

Sinks catch their own storage failures, so a full disk or locked file never crashes code that was just trying to log.

07

Row-based retention

Entries older than RetainedDays (365 by default) are deleted on a schedule and the file is vacuumed. The file itself is never rolled or replaced.

08

MindAttic Log Reader

A WPF and WebView2 desktop viewer that discovers every app's database, SQLite or SQL Server, and filters by date range, level, application, category and message text.

09

A one-shot migrator

MindAtticLogMigrator copies an app's SQLite history into SQL Server. It only reads the source and, re-run, copies only rows it has not copied yet.

How it works

From scattered output to queryable history

  1. Add the package

    Reference MindAttic.Log (net9.0 or net10.0).

  2. Register it

    Call AddMindAtticLog with your application name and a database path or connection string.

  3. Log as usual

    Inject ILogger<T> and keep calling it; rows are batched into the store.

  4. Read it

    Open the Reader to browse and filter every app's logs in one place.

Quick start

Wire it into an app

With no connection string the app stays on its own SQLite file.

The full setup guide lives in the documentation.

csharp
services.AddMindAtticLog(o =>
{
    o.Application = "MyApp";
    o.DbPath = VaultPaths.LoggingDbPath("MyApp"); // resolved via MindAttic.Vault
});

// or a shared SQL Server database:
// o.ConnectionString = configuration.GetConnectionString("MindAttic.Log");

Part of MindAttic

One piece of a bigger workshop

MindAttic.Log is the family's logging backbone. Version 3.0.0 is consumed by Prose, MindAttic.Orchestrator, MindAttic.Tickets, MindAttic.Vault, MindAttic.Launcher, IdiotProof and more, and log locations are resolved through MindAttic.Vault so the Reader can find every app's logs on its own.

It is deliberately not a log aggregation server: there is no daemon and no ingestion API. Each app owns its file, and the Reader reads those files directly.

Status

Where it stands

Active

3.0 in use across the family; 4.0 brings two stores

Version 3.0.0 is in daily use by around twenty apps. The SQL Server store, the store registry and the SQLite-to-SQL-Server migrator are built on main; the 4.0 release puts the never-throw sink contract under test, packs 4.0.0 and brings the canon docs up to date for both stores.

Current milestone: MindAttic.Log 4.0: two stores and a guarded sink.

Next step

Give your logs somewhere to live

Guides, reference and design notes are in the searchable MindAttic documentation. The source, issues and history are on GitHub.