MindAttic.Log
MindAttic.Log
One strict logging schema for every MindAttic app, written to one standalone MindAttic.Log.db SQLite database per app, stored under MindAttic.Vault's shared roaming root rather than any one app's own data folder.
Scope
The complete product, built and planned, is specified in docs/SPEC.md; the current finish line is docs/RELEASE.md. MindAttic.Log 4.0 (MS-50) is the finished library: both stores released and the sink contract under test.
Why
Across the MindAttic ecosystem (see docs/MIGRATION.md), most apps already call ILogger<T> at their call sites but have no durable sink underneath — output goes nowhere, or to ad hoc Console.Write*/hand-rolled file writers that nobody can filter or query. MindAttic.Log replaces all of that with one package: apps keep calling ILogger<T>, and this library becomes the sink.
A flat text file is also a dead end for anything but tail/grep — there's no index, and "one giant monolithic log" degrades as it grows. Prior art (Blacklite, logdive — see docs/BIBLE.md §4) found that an embedded SQLite file beats parsing flat text for queryability while staying what a "log file" is supposed to be: one portable file, no server.
Every app gets its own standalone MindAttic.Log.db, full stop — no sharing an app's SQL Server database or its own SQLite file, and no per-app location choice. The file lives at %APPDATA%\MindAttic\Logging\<appId>\MindAttic.Log.db (resolved via MindAttic.Vault's VaultPaths.LoggingDbPath), deliberately under Vault's shared roaming root rather than the app's own %LocalAppData% — so clearing an app's local cache/data folder can never take its logs with it. Retention is row-based (delete-then-VACUUM on a schedule), not file-rolling, since the file is never replaced.
What's in this repo
MindAttic.Log— the shared library.LogEntry/LogSeverity(the wire schema),LogSchema(the DDL), a custom batchedILogEventSinkfor SQLite (WAL mode, so a Reader can query live, plus a row-based retention sweep),services.AddMindAtticLog(...)to wire it into DI, andMindAtticLogMigrator— a one-shot, explicitly-invoked tool for copying an app's historical rows out of the retired SQL Server/app-owned-SQLite tiers (seedocs/MIGRATION.md).MindAttic.Log.Reader— a WPF + WebView2 desktop viewer (same shape as Automata.App/KdpPublish, not Blazor) that discovers every app's standalone database under Vault'sLoggingbucket and lets you switch between them. Filters by date range, level, application, category, and message text.docs/BIBLE.md— architecture canon: why this schema, why SQLite, the laws.docs/MIGRATION.md— tracks which MindAttic apps have been audited and migrated.
Using it
services.AddMindAtticLog(o =>
{
o.Application = "MindAttic.Launcher";
o.DbPath = VaultPaths.LoggingDbPath("MindAttic.Launcher"); // resolved via MindAttic.Vault
});
An app that should log to SQL Server instead sets a connection string from its configuration; every such app shares the one MindAttic.Log database (created on first write if it's missing) and is told apart by the Application column:
services.AddMindAtticLog(o =>
{
o.Application = "MindAttic.Launcher";
o.ConnectionString = configuration.GetConnectionString("MindAttic.Log");
// e.g. Server=localhost;Database=MindAttic.Log;Integrated Security=true;TrustServerCertificate=true
});
With no connection string the app stays on SQLite. o.Store names a registered store explicitly ("sqlite", "sqlserver") when the configuration alone shouldn't decide.
To bring an app's existing SQLite history along when it moves to SQL Server, run the migrator once with the same two values; it only reads the .db file and, re-run, copies only rows it hasn't copied yet:
await MindAtticLogMigrator.MigrateSqliteToSqlServerAsync(dbPath, connectionString);
Application code is unchanged: inject ILogger<T> and call it as usual.
Building
dotnet build MindAttic.Log.slnx dotnet test MindAttic.Log.slnx
Part of MindAttic — see more projects at github.com/mindattic.
Pages in this repository
- MindAttic.Log — Project Bible — MindAttic.Log is the one logging pipeline for every MindAttic app: a strict shared schema (LogEntry/MindAttic_Log) that every app writes…
- Code ledger: MindAttic.Log — Every tracked source file and the ticket in this repo's tree that accounts for it (MAT-T484; method:…
- MindAttic.Log — Migration tracker — Read from each app's own repo on 2026-12-01. Twenty-two entry points in twenty apps write to MindAttic.Log, each into its own standalone…
- MindAttic.Log — Release charter — The one logging pipeline for every MindAttic app: a strict schema written through ILogger<T> to a per-app MindAttic.Log.db (or the shared…
- MindAttic.Log — Product specification — In docs/ECOSYSTEM.md MindAttic.Log owns the logging concern: every app logs through it, and no app keeps its own log files.