diff --git a/Directory.Packages.props b/Directory.Packages.props
index 2c3cff5c..be46b98e 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -185,6 +185,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/adr/0071-compono-logging-host-wide-log-capture.md b/docs/adr/0071-compono-logging-host-wide-log-capture.md
index 4173f17c..0f114d97 100644
--- a/docs/adr/0071-compono-logging-host-wide-log-capture.md
+++ b/docs/adr/0071-compono-logging-host-wide-log-capture.md
@@ -510,6 +510,87 @@ the pointer.
- **Option 3.** Good: no surface. Bad: the scenario's headline assertion
reads as a lambda with an opaque failure message.
+### Amendment 1 (2026-11-11) — `[ProviderAlias]` availability is net10.0+ only
+
+Implementation (PLAN-0072 B2/B3) found that the "Package identity and
+dependency graph" fact above — that `ProviderAliasAttribute` is available
+from `Microsoft.Extensions.Logging.Abstractions` alone — holds only on
+net10.0/net11.0. On net8.0/net9.0 the attribute lives in the concrete
+`Microsoft.Extensions.Logging` implementation package, which this package
+must not reference (the shipped graph above stays Abstractions-only, and
+B7 requires the packed dependency groups to remain byte-for-byte identical
+to `main`). Unconditional use failed to compile on net8/net9 with
+`CS0246: ProviderAliasAttribute could not be found`.
+
+Resolution: the `[ProviderAlias("Compono")]` attribute on the internal
+provider is compiled only under `NET10_0_OR_GREATER`. Consequences,
+unchanged in intent but now explicitly version-scoped:
+
+- The `Logging:Compono:LogLevel` provider-specific filter rule works on
+ net10.0/net11.0; tests covering it are `#if NET10_0_OR_GREATER`.
+- On net8.0/net9.0, consumers use the global host minimum
+ (`SetMinimumLevel`) or category `AddFilter` rules instead.
+- Host-wide capture, `LogCollector`, filtering, ownership/disposal, and
+ every other decision in this ADR are unaffected on all four TFMs.
+
+No public API or dependency changes.
+
+### Amendment 2 (2026-11-11) — the `Compono` alias works on every target framework
+
+Independent review of PR #177 found that Amendment 1's premise was
+imprecise and its conclusion unnecessary. This amendment corrects it;
+Amendment 1's text stays as recorded.
+
+**Corrected facts** (verified against the restored packages and by
+experiment):
+
+- Availability tracks the **Abstractions package version**, not the
+ target framework. `ProviderAliasAttribute` is absent from every lib
+ asset of `Microsoft.Extensions.Logging.Abstractions` 8.0.2 and 9.0.23,
+ and present in every lib asset (including `lib/net8.0`) of 10.0.15 and
+ 11.0.0. Amendment 1's `NET10_0_OR_GREATER` split only lined up with
+ that because this package pins Abstractions to the 8.x/9.x line on
+ net8.0/net9.0 (`Directory.Packages.props`).
+- `Microsoft.Extensions.Logging` resolves a provider's alias **by the
+ attribute's full type name** (`CustomAttributeData`, comparing
+ `"Microsoft.Extensions.Logging.ProviderAliasAttribute"`), not by type
+ identity. A locally defined attribute with that exact full name is
+ honored; the same simple name in another namespace is not.
+- Consequence of Amendment 1 as shipped on net8.0/net9.0:
+ `Logging:Compono:*` rules were silently ignored, while
+ `Logging:Compono.Logging.ComponoLogCollectorProvider:*` (the internal
+ type's full name) did work — an accidental configuration surface.
+
+**Decision:** keep `[ProviderAlias("Compono")]` unconditional. On
+net8.0/net9.0 (`#if !NET10_0_OR_GREATER`) the package compiles an
+**internal** `Microsoft.Extensions.Logging.ProviderAliasAttribute` with the
+framework attribute's exact full name and constructor shape; on
+net10.0/net11.0 the real attribute from Abstractions is used and the copy
+compiles to nothing.
+
+**Verified before adopting it:**
+
+- Recognition: `Logging:Compono:LogLevel:*` (default and category-prefix
+ rules) applies to the Compono provider and not to other providers, under
+ a real Generic Host, in `Compono.Logging.Tests` on all four TFMs.
+- No new dependencies: the project file and packed dependency groups are
+ unchanged.
+- No type-identity collision: the copy is internal, so consumers never see
+ it. A net8.0/net9.0 consumer that references both Compono.Logging and
+ `Microsoft.Extensions.Logging` and applies the public
+ `[ProviderAlias(...)]` to its own provider compiles with warnings as
+ errors and binds to the public attribute. If an Abstractions 10.x+
+ reference ever reached net8.0/net9.0, the compiler would flag the
+ duplicate (CS0436), which `Compono.Logging.csproj` promotes to an error,
+ instead of changing behavior silently.
+- Native AOT: that consumer, published with `PublishAot=true` for net8.0
+ and net9.0, produced no IL2xxx/IL3xxx warnings and honored the alias at
+ runtime. net10.0 keeps its existing `Compono.Logging.AotSmokeTest`
+ coverage.
+
+Public API, dependency graph, and every other decision in this ADR are
+unchanged. Documentation no longer carries a net8/net9 alias caveat.
+
## Links
- Issue [#164](https://github.com/LayeredCraft/compono/issues/164); parent
diff --git a/docs/documentation-architecture.md b/docs/documentation-architecture.md
index 4f2e2974..8c21867c 100644
--- a/docs/documentation-architecture.md
+++ b/docs/documentation-architecture.md
@@ -118,7 +118,8 @@ docs/
│ ├── customize-a-member.md
│ ├── register-a-type.md
│ ├── use-profiles.md
-│ └── share-a-value-across-a-test.md
+│ ├── share-a-value-across-a-test.md
+│ └── assert-nothing-logged-at-error-across-a-host.md
├── cookbook/
│ ├── index.md
│ └── `," "why are Debug entries missing
+ from `LogCollector`").
- `faq.md` — questions that don't map to a single diagnostic but come up
repeatedly ("why does Compono fail fast on recursion instead of omitting
a value like AutoFixture did" is exactly this shape — a real gap-3
diff --git a/docs/how-to/assert-nothing-logged-at-error-across-a-host.md b/docs/how-to/assert-nothing-logged-at-error-across-a-host.md
new file mode 100644
index 00000000..caa4ce95
--- /dev/null
+++ b/docs/how-to/assert-nothing-logged-at-error-across-a-host.md
@@ -0,0 +1,184 @@
+# How Do I Assert Nothing Logged at Error or Above Across a Generic Host?
+
+Register a `LogCollector` on the host's logging pipeline, run the host,
+then verify the collector. The collector is the test-owned capture
+destination: it sees every category the host logs to, regardless of which
+`ILogger` produced the entry. See
+[`Compono.Logging`'s Package Guide](../packages/compono-logging.md#host-wide-capture-with-logcollector-and-addcomponocapture)
+for the full host-wide semantics.
+
+## Basic case
+
+```csharp
+using Compono.Logging;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Hosting;
+using Microsoft.Extensions.Logging;
+
+[Fact]
+public async Task Startup_LogsNothingAtErrorOrAbove()
+{
+ var builder = Host.CreateApplicationBuilder();
+ var logs = new LogCollector();
+
+ builder.Logging.ClearProviders();
+ builder.Logging.AddComponoCapture(logs);
+
+ using var app = builder.Build();
+ await app.StartAsync(TestContext.Current.CancellationToken);
+ await app.StopAsync(TestContext.Current.CancellationToken);
+
+ logs.Verify().AtLevelOrAbove(LogLevel.Error).Never();
+}
+```
+
+`AtLevelOrAbove(LogLevel.Error)` matches `Error` and `Critical`;
+`LogLevel.None` never matches. `Never()` fails the test with a message
+naming the filter and how many entries matched:
+
+```text
+Expected exactly 0 call(s) to a log entry matching level Error or above, but received 1.
+```
+
+The message doesn't list the offending entries. To see them, read the
+collector — for example
+`logs.GetCapturedEntries().Where(entry => entry.LogLevel >= LogLevel.Error)`
+— in the failing test or a debugger.
+
+## Narrow it to one category
+
+Add `InCategory` when only one subsystem should be checked. The match is
+an exact, ordinal, case-sensitive comparison of the entry's `Category`:
+
+```csharp
+logs.Verify()
+ .AtLevelOrAbove(LogLevel.Error)
+ .InCategory("MyApp.Payments.PaymentGateway")
+ .Never();
+```
+
+For a host entry, `Category` is exactly the string the logging pipeline
+passed to `ILoggerProvider.CreateLogger` — for an `ILogger`,
+the type's full name (`MyApp.Payments.PaymentGateway`), not its namespace
+or a short name.
+
+`InCategory` never matches by prefix, unlike the host's own `AddFilter`
+and `Logging:LogLevel:*` rules. A category string that matches nothing
+makes `Never()` pass without checking anything. To cover a whole
+namespace, match the prefix explicitly:
+
+```csharp
+logs.Verify()
+ .AtLevelOrAbove(LogLevel.Error)
+ .Matching(entry => entry.Category.StartsWith("MyApp.Payments.", StringComparison.Ordinal))
+ .Never();
+```
+
+## What the host may not capture
+
+Compono never changes the host's own filter rules. The default host
+minimum level is `Information`, so `Debug` and `Trace` entries never reach
+the collector unless the host is configured to allow them:
+
+```csharp
+ builder.Logging.SetMinimumLevel(LogLevel.Trace);
+```
+
+If the host filters a category out with `AddFilter`, that category is
+absent from the collector too. To filter only what the collector sees, use
+the provider's `Compono` alias in configuration, for example
+`Logging:Compono:LogLevel:Default`. This is intentional: the collector reports
+what the host actually logged, not what any logger attempted to log.
+
+## Keep the collector for the whole test
+
+The test owns the `LogCollector`; the host only writes to it. Disposing the
+host stops further capture through that host, but entries already captured
+stay readable — so you can assert after `Dispose()`/`await using` without
+copying anything out first. A collector can also be shared by more than one
+host in the same test; each host keeps appending until it is disposed.
+
+## Using `WebApplicationFactory`
+
+The same registration works through `ConfigureLogging`:
+
+```csharp
+public sealed class ApiFactory : WebApplicationFactory
+{
+ public LogCollector Logs { get; } = new();
+
+ protected override void ConfigureWebHost(IWebHostBuilder builder) =>
+ builder.ConfigureLogging(logging =>
+ {
+ logging.ClearProviders();
+ logging.AddComponoCapture(Logs);
+ });
+}
+```
+
+Then assert `factory.Logs.Verify().AtLevelOrAbove(LogLevel.Error).Never()`
+after the request or startup path under test.
+
+A factory shared across tests (an xUnit class or collection fixture)
+shares one collector, and the collector keeps every entry with no size
+limit. An error logged by one test would then fail another test's
+`Never()`. Clear it at the start of each test:
+
+```csharp
+public sealed class CheckoutTests(ApiFactory factory) : IClassFixture
+{
+ [Fact]
+ public async Task Checkout_LogsNothingAtErrorOrAbove()
+ {
+ factory.Logs.ClearCapturedEntries();
+
+ var client = factory.CreateClient();
+ await client.PostAsync("/checkout", null, TestContext.Current.CancellationToken);
+
+ factory.Logs.Verify().AtLevelOrAbove(LogLevel.Error).Never();
+ }
+}
+```
+
+## When the collector stays empty
+
+If the application replaces the host's `ILoggerFactory` with one that
+ignores registered providers — for example Serilog's `UseSerilog()`
+without `writeToProviders: true` — or calls `ClearProviders()` *after* the
+test registered the collector, nothing reaches the collector and `Never()`
+passes without checking anything.
+
+Guard against a silently-empty collector by asserting it saw a known entry.
+What to assert depends on the host:
+
+- **Generic Host with its default lifetime.** After `StartAsync` the host
+ itself logs "Application started" under `Microsoft.Hosting.Lifetime`, so:
+
+ ```csharp
+ logs.Verify().InCategory("Microsoft.Hosting.Lifetime").AtLeast(1);
+ ```
+
+- **`WebApplicationFactory` / ASP.NET Core `TestHost`.** Don't depend on
+ framework startup logging: `TestHost` runs a different host lifetime, and
+ a shared fixture may clear startup entries between tests. Assert a
+ deterministic entry your own code emits during the operation under test
+ instead:
+
+ ```csharp
+ // The code under test logs this while handling the request.
+ factory.Logs.Verify()
+ .Matching(entry => entry.Message.Contains("Checkout started"))
+ .AtLeast(1);
+ ```
+
+ If you prefer to assert on framework request diagnostics, first confirm
+ the exact category they log under for your logging configuration rather
+ than assuming one.
+
+## See also
+
+- [Host-wide capture](../packages/compono-logging.md#host-wide-capture-with-logcollector-and-addcomponocapture)
+ — Category, filters, ownership, and cardinality rules.
+- [Share a Value Across a Test](share-a-value-across-a-test.md) — when a
+ service under test needs a specific `ILogger` rather than host-wide
+ capture.
diff --git a/docs/how-to/index.md b/docs/how-to/index.md
index 4641eb01..640add9a 100644
--- a/docs/how-to/index.md
+++ b/docs/how-to/index.md
@@ -10,6 +10,7 @@ specific job:
- [Register a Type](register-a-type.md)
- [Use Profiles](use-profiles.md)
- [Share a Value Across a Test](share-a-value-across-a-test.md)
+- [Assert Nothing Logged at Error or Above Across a Generic Host](assert-nothing-logged-at-error-across-a-host.md)
Looking for something integration-specific — "how do I use NSubstitute" or
"how do I use Bogus"? That lives in the relevant
diff --git a/docs/packages/compono-logging.md b/docs/packages/compono-logging.md
index 5c350730..ddaa00a9 100644
--- a/docs/packages/compono-logging.md
+++ b/docs/packages/compono-logging.md
@@ -1,13 +1,17 @@
# Compono.Logging
-First-class `Microsoft.Extensions.Logging` testing support — `ILogger`/
+First-class `Microsoft.Extensions.Logging` testing support. `ILogger`/
`ILogger` compose naturally through `UseLogging()`, backed by a
hand-written `CapturingLogger`/`CapturingLogger` pair (real scope
tracking, thread-safe capture, reflection-free structured-property
extraction) and Compono-native `Verify()` verification reusing core
-`Compono`'s `CallVerifier` unmodified. See
+`Compono`'s `CallVerifier` unmodified. A test-owned `LogCollector`
+registered with `AddComponoCapture()` captures a real Generic Host's
+*host-wide* output — every category, not just loggers Compono composed —
+so a test can assert something like "nothing at `Error` or above was
+logged anywhere in the host." See
[ADR-0055](../adr/0055-compono-logging-testing-support-package.md) (and
-its three amendments) for the full decision record and
+its amendments) for the full decision record and
[RESEARCH-0013](../research/0013-compono-logging-testing-design-research.md)
for the design investigation this package's shape came from.
@@ -79,7 +83,8 @@ Console.WriteLine(failure.Properties?.First().Key); // "OrderId", e.g.
`ClearCapturedEntries()`** — direct inspection, no assertion framework
required.
- **`logger.Verify()`** — the fluent entry point:
- `.AtLevel(level)`, `.WithEventId(id)`, `.WithException()`,
+ `.AtLevel(level)`, `.AtLevelOrAbove(level)`, `.InCategory(category)`,
+ `.WithEventId(id)`, `.WithException()`,
`.WithMessageContaining(text)`, `.Matching(predicate)`, ending in
`.Once()` / `.Never()` / `.Exactly(n)` / `.AtLeast(n)` / `.AtMost(n)`
([ADR-0044 Amendment 22](../adr/0044-compono-testdoubles-v2-overloads-generics-verification.md#amendment-22-2026-09-06-callverifieratleastintatmostint-added-requirement-3s-minimality-preserved-not-reversed))
@@ -99,6 +104,185 @@ Console.WriteLine(failure.Properties?.First().Key); // "OrderId", e.g.
A provider-composed logger and a directly-constructed one behave
identically — one implementation, not two.
+## Host-wide capture with LogCollector and AddComponoCapture
+
+Composed loggers only see what Compono composed. A real Generic Host (or
+`WebApplicationFactory`, or anything else with an
+`Microsoft.Extensions.Logging.ILoggingBuilder`) also logs through
+categories your test never composed — framework lifetime messages,
+libraries, your own `ILogger` resolved from `host.Services`. Register a
+test-owned `LogCollector` to capture all of it:
+
+```csharp
+using Compono.Logging;
+using Microsoft.Extensions.Hosting;
+using Microsoft.Extensions.Logging;
+
+var logs = new LogCollector();
+var builder = Host.CreateApplicationBuilder();
+builder.Logging.ClearProviders(); // optional: drop console/debug noise
+builder.Logging.AddComponoCapture(logs);
+using var host = builder.Build();
+
+// ... start the host, call the code under test ...
+
+logs.Verify().AtLevelOrAbove(LogLevel.Error).Never();
+
+// One logger's category - the full name of its ILogger type, matched exactly:
+logs.Verify()
+ .AtLevelOrAbove(LogLevel.Error)
+ .InCategory("MyApp.Payments.PaymentGateway")
+ .Never();
+```
+
+`AddComponoCapture` returns the same builder, so it chains; it also works
+from `services.AddLogging(logging => logging.AddComponoCapture(logs))` and
+`WebApplicationFactory.ConfigureLogging`. It is additive: it never changes
+the host's filter rules.
+
+```csharp
+logs.GetCapturedEntries();
+logs.GetLastCapturedEntry();
+logs.ClearCapturedEntries();
+logs.Verify().AtLevelOrAbove(LogLevel.Warning).AtLeast(1);
+```
+
+### `Category`
+
+Every `CapturedLogEntry` carries `Category`:
+
+- Host-captured entries: the exact string passed to
+ `ILoggerProvider.CreateLogger(category)`.
+- Composed/directly-constructed `CapturingLogger`: the same string
+ `LoggerFactory.CreateLogger()` produces (full name, `.`-separated
+ nesting, generic arity and arguments removed, C# keyword names for
+ built-ins).
+- Non-generic `CapturingLogger` and a bare composed `ILogger`: `""`.
+
+`InCategory` is exact, ordinal, case-sensitive: `InCategory("MyApp.Payments")`
+does **not** match an entry whose category is
+`MyApp.Payments.PaymentGateway`. This differs from the host's own filter
+rules — `AddFilter("MyApp.Payments", ...)` and `Logging:LogLevel:MyApp.Payments`
+configuration match every category that *starts with* that prefix. Combined
+with `Never()`, a category string that matches nothing passes without
+checking anything, so use the full category name, or assert by prefix
+explicitly:
+
+```csharp
+logs.Verify()
+ .AtLevelOrAbove(LogLevel.Error)
+ .Matching(entry => entry.Category.StartsWith("MyApp.Payments.", StringComparison.Ordinal))
+ .Never();
+```
+
+> **Behavioral compatibility note.** `Category` is part of
+> `CapturedLogEntry`'s record value equality: two entries identical in
+> every other field but produced by different categories are **not** equal
+> under `Equals`, `==`, or `!=`. This is an intentional behavioral change
+> from earlier previews (not a source or binary breaking change), decided
+> in [ADR-0071](../adr/0071-compono-logging-host-wide-log-capture.md).
+
+### Filters
+
+Two filters exist for the host-wide scenario and behave identically on a
+composed `logger.Verify()` and a `LogCollector.Verify()`:
+
+- `.AtLevelOrAbove(level)` — `Error` matches `Error` and `Critical`.
+ `AtLevelOrAbove(LogLevel.None)` matches nothing.
+- `.InCategory(category)` — exact ordinal match; `null` throws
+ `ArgumentNullException`.
+
+Both contribute to the failure text, e.g. `Expected exactly 0 call(s) to a
+log entry matching level Error or above, but received 1.` The message
+names the filters and the match count only — it does not list the matching
+entries. Read them with `GetCapturedEntries()` when diagnosing a failure.
+
+### Host filtering still applies
+
+The host's own `LoggerFilterOptions` decides what reaches the collector;
+`AddComponoCapture` does not override it. Under a default host (minimum
+`Information`), `Debug`/`Trace` are not captured. Lower the host's own
+level if you need them:
+
+```csharp
+builder.Logging.SetMinimumLevel(LogLevel.Trace);
+// or a category rule (prefix match: covers MyApp.Payments.*):
+builder.Logging.AddFilter("MyApp.Payments", LogLevel.Debug);
+```
+
+The provider is registered under the `Compono` alias, so a rule that
+targets only the Compono provider works on every supported target
+framework (net8.0 through net11.0):
+
+```json
+{ "Logging": { "Compono": { "LogLevel": { "Default": "Warning" } } } }
+```
+
+`LogLevel.None` is never captured on any target framework.
+
+### Host vs. composed: separate destinations
+
+In this release the two capture destinations are deliberately separate:
+
+- Host loggers (anything created by the host's `ILoggerFactory`, including
+ a container-resolved `ILogger`) write only to the registered
+ `LogCollector`.
+- Loggers composed by `UseLogging()` keep their own per-logger capture
+ store, exactly as before.
+
+`GetCapturedEntries()`/`Verify()` on a host `ILogger` still throw
+`InvalidOperationException` (it is not a Compono capturing logger); the
+message now points at `LogCollector`/`AddComponoCapture`. Read and verify
+through the collector instead. Opt-in forwarding is deferred.
+
+### Ownership, lifetime, and cardinality
+
+- The test owns the `LogCollector`. The host owns only its provider. The
+ collector is never disposed, cleared, or detached by the host and stays
+ readable after the host is disposed.
+- Disposing the host stops new capture through its provider. Held loggers
+ become disabled (`IsEnabled` is `false`, `Log` is a no-op, `BeginScope`
+ still returns a usable disposable); entries captured before disposal
+ remain, and `ClearCapturedEntries()` still works.
+- Registering the **same** collector twice on one builder is idempotent:
+ one provider, one copy of each entry. Duplicate detection follows the
+ provider registrations themselves, so after `ClearProviders()` removes
+ the provider, registering the same collector again adds it back. Different collectors on one builder
+ each get their own provider and both receive every entry. The same
+ collector across several hosts receives entries from all of them;
+ disposing one host stops only that host.
+- One private lock per collector guards appends, clears, and reads; reads
+ return snapshots. There is no static/ambient state, so parallel tests with
+ their own hosts and collectors do not interfere.
+- Scopes come from the host's shared scope provider, not per logger: a
+ scope opened with `BeginScope` on one host logger also appears in the
+ `Scopes` of entries other categories log inside it on the same async
+ flow — the standard `Microsoft.Extensions.Logging` behavior. Composed
+ loggers keep a per-logger scope stack instead.
+- Activity scopes configured through `LoggerFactoryOptions
+ .ActivityTrackingOptions` appear in `Scopes` like any other scope.
+- The collector keeps every entry until you call `ClearCapturedEntries()`;
+ there is no size limit. A collector shared by many tests (for example a
+ `WebApplicationFactory` fixture) accumulates entries across them — clear
+ it at the start of each test, or give each test its own collector.
+
+### When nothing is captured
+
+Capture relies on the host's `ILoggerFactory` dispatching to registered
+`ILoggerProvider`s. A host that **replaces** `ILoggerFactory` with one that
+ignores registered providers bypasses the collector entirely — for
+example Serilog's `UseSerilog()` without `writeToProviders: true`. Then
+`Never()` passes because nothing was captured, not because nothing was
+logged. Likewise, a `ClearProviders()` call that runs *after*
+`AddComponoCapture` (for example in the application's own startup code)
+removes the Compono provider. When in doubt, assert the collector saw a
+known entry so an empty collector fails loudly. On a Generic Host with its
+default lifetime, the `Microsoft.Hosting.Lifetime` "Application started"
+entry after `StartAsync` works; under a `WebApplicationFactory`/ASP.NET
+Core `TestHost`, prefer a deterministic entry your own code emits during
+the operation under test — `TestHost` runs a different host lifetime, and a
+shared fixture may clear startup entries between tests.
+
## Structured properties and `MessageTemplate`
`CapturedLogEntry` carries both the raw `State` (always present, the
@@ -107,6 +291,7 @@ escape hatch) and derived, reflection-free structured fields:
```csharp
public readonly record struct CapturedLogEntry
{
+ public string Category { get; } // ADR-0071; part of value equality
public LogLevel LogLevel { get; }
public EventId EventId { get; }
public Exception? Exception { get; }
@@ -173,7 +358,10 @@ time:
latter only possible when `ComponoGeneratedLogging` is explicitly
disabled, since it's otherwise excluded from generation, Amendment 4).
Most common cause: `UseNSubstitute()` was registered *before*
- `UseLogging()` — see "Registration order," below.
+ `UseLogging()` — see "Registration order," below. A container-resolved
+ `ILogger` from a real host hits this too: it is the host's logger,
+ not a Compono one — capture it with `LogCollector`/`AddComponoCapture`
+ instead.
2. **`LoggingProvider` recognized a closed `ILogger` request but found
no generated activation for it** (`InvalidOperationException`, at
composition time, at runtime) — the category type isn't reachable from
@@ -291,7 +479,9 @@ this section used to describe as unsolved.
Deliberately not in this package — see ADR-0055's Decision Outcome for
the rationale behind each:
-- `ILoggerFactory` composition.
+- Composing/replacing a host's `ILoggerFactory`. (A host *provider* that
+ captures into a test-owned `LogCollector` is supported — see "Host-wide
+ capture," above.)
- Serilog-specific or other logging-provider-specific behavior.
- Test-runner output capture/routing (a different problem —
`TUnit.Logging.Microsoft`'s concern, not behavior verification).
@@ -315,4 +505,4 @@ the rationale behind each:
note above if a composed type depends on both an `ILogger` and another
interface.
- [ADR-0055](../adr/0055-compono-logging-testing-support-package.md) —
- the full decision record, including its three amendments.
+ the full decision record, including its amendments.
diff --git a/docs/plans/0072-compono-logging-host-wide-log-capture-and-dotnet-11-ga-impl-plan.md b/docs/plans/0072-compono-logging-host-wide-log-capture-and-dotnet-11-ga-impl-plan.md
index e631db87..330cbcda 100644
--- a/docs/plans/0072-compono-logging-host-wide-log-capture-and-dotnet-11-ga-impl-plan.md
+++ b/docs/plans/0072-compono-logging-host-wide-log-capture-and-dotnet-11-ga-impl-plan.md
@@ -1,6 +1,6 @@
# [PLAN-0072] `Compono.Logging` Host-Wide Log Capture (Issue #164) + .NET 11 GA Migration
-**Status:** In Progress
+**Status:** Done
**Implements:** [ADR-0071](../adr/0071-compono-logging-host-wide-log-capture.md)
(issue [#164](https://github.com/LayeredCraft/compono/issues/164), child of
@@ -9,8 +9,9 @@
ADR-0071 is **Accepted** (2026-11-10). The maintainer approved ADR-0071 and
this plan, including the review-round-1 clarifications in `768af68`, and
B0 is closed. Architectural approval is complete. The accepted planning
-artifacts now live on `main` (merged via PR #175). Implementation has
-started: B1 (PR 1, .NET 11 GA) is in progress.
+artifacts now live on `main` (merged via PR #175). Implementation is
+complete: B1 (.NET 11 GA, PR #176) merged, and B2-B7 (host-wide log capture)
+are implemented and validated on `feat/164-host-wide-log-capture`.
## Goal
@@ -206,7 +207,7 @@ this plan's Notes. Tick B1.
- [x] B1.2 net11.0 package ranges (`Directory.Packages.props`)
- [x] B1.3 Current-state docs sweep (confirm or fix)
- [x] B1.4 Full validation (V1, V3, V6, V7, V8) on 11.0.100, results recorded in Notes
-- [ ] B1.5 PR 1 merged
+- [x] B1.5 PR 1 merged
---
@@ -273,11 +274,11 @@ added to the not-a-capturing-logger message),
and `test/Compono.Generators.Tests`' logging tests green (activation
unchanged).
-- [ ] B2.1 `Category` + shared entry construction refactor
-- [ ] B2.2 MEL-parity category naming
-- [ ] B2.3 `AtLevelOrAbove` / `InCategory`
-- [ ] B2.4 Exception-message sentence
-- [ ] B2.5 Tests above, focused suites green
+- [x] B2.1 `Category` + shared entry construction refactor
+- [x] B2.2 MEL-parity category naming
+- [x] B2.3 `AtLevelOrAbove` / `InCategory`
+- [x] B2.4 Exception-message sentence
+- [x] B2.5 Tests above, focused suites green
### B3: `LogCollector`, internal provider, `AddComponoCapture`
@@ -340,11 +341,11 @@ these never reach a `.nuspec`.
on all TFMs, and no new `PackageReference` in the shipped project
(`git diff src/Compono.Logging/Compono.Logging.csproj` shows none).
-- [ ] B3.1 `LogCollector`
-- [ ] B3.2 Internal provider/logger (`ISupportExternalScope`, `[ProviderAlias("Compono")]`)
-- [ ] B3.3 `AddComponoCapture` with the cardinality rules
-- [ ] B3.4 Test-only package wiring
-- [ ] B3.5 Core host tests green
+- [x] B3.1 `LogCollector`
+- [x] B3.2 Internal provider/logger (`ISupportExternalScope`, `[ProviderAlias("Compono")]`)
+- [x] B3.3 `AddComponoCapture` with the cardinality rules
+- [x] B3.4 Test-only package wiring
+- [x] B3.5 Core host tests green
### B4: edge cases, concurrency, isolation, negative tests
@@ -394,10 +395,10 @@ only to fix defects these tests reveal (note any in Notes).
**Acceptance:** `dotnet test test/Compono.Logging.Tests` green; then
**full** `dotnet build && dotnet test` green (the first full run on PR 2).
-- [ ] B4.1 Cardinality + disposal
-- [ ] B4.2 Isolation + bounded concurrency
-- [ ] B4.3 Separation, host-logger misuse, activity scopes, exceptions
-- [ ] B4.4 Full suite green
+- [x] B4.1 Cardinality + disposal
+- [x] B4.2 Isolation + bounded concurrency
+- [x] B4.3 Separation, host-logger misuse, activity scopes, exceptions
+- [x] B4.4 Full suite green
### B5: Native AOT + package compatibility
@@ -429,9 +430,9 @@ assertion is missing for `Compono.Logging`).
**Acceptance:** V3 (Logging leg), V5, V6, V7 pass, with results recorded in
Notes.
-- [ ] B5.1 AOT smoke test extended, publish clean, binary passes
-- [ ] B5.2 Pack-and-consume
-- [ ] B5.3 ApiCompat + nuspec dependency check
+- [x] B5.1 AOT smoke test extended, publish clean, binary passes
+- [x] B5.2 Pack-and-consume
+- [x] B5.3 ApiCompat + nuspec dependency check
### B6: docs, examples, API reference, `compono` skill
@@ -478,10 +479,10 @@ Notes.
regeneration, V8 passes, every relative link resolves, and the docs
describe only shipped behavior.
-- [ ] B6.1 Package doc + recipe + troubleshooting
-- [ ] B6.2 API reference regenerated
-- [ ] B6.3 Skill reference + evals
-- [ ] B6.4 Link and validation checks
+- [x] B6.1 Package doc + recipe + troubleshooting
+- [x] B6.2 API reference regenerated
+- [x] B6.3 Skill reference + evals
+- [x] B6.4 Link and validation checks
### B7: final integration and release-readiness gate
@@ -514,9 +515,9 @@ and B4, B5, and B6 done.
- Set PLAN-0072 to `Done`, tick all tasks, and close the beads. The PR
references #164 (it closes #164, not #161).
-- [ ] B7.1 Full validation green
-- [ ] B7.2 Acceptance-criteria cross-check table in Notes
-- [ ] B7.3 Plan closeout, PR 2 opened with product-owner approval
+- [x] B7.1 Full validation green
+- [x] B7.2 Acceptance-criteria cross-check table in Notes
+- [x] B7.3 Plan closeout, PR 2 opened with product-owner approval (PR #177)
### B0: product-owner acceptance (precedes everything)
@@ -655,3 +656,175 @@ python3 -c "import json;json.load(open('skills/compono/evals/evals.json'))"
- Preview/RC grep: the only tracked match outside `docs/adr`, `docs/research`,
`docs/plans`, `docs/reference/api` is the intentional RC.1 history line in
`package-validation.yaml`.
+
+- 2026-11-11 (B2-B6 implementation, branch `feat/164-host-wide-log-capture`):
+ - Source: `CapturedLogEntry.Category`; one shared entry-construction path
+ (`LogEntryFactory`) used by both `LogEntryCollector` and the host
+ provider; `LoggerCategoryName` reproduces MEL's
+ `TypeNameHelper.GetTypeDisplayName` result without reflection beyond
+ trim-safe `Type` name properties; `LogCollector` +
+ `ComponoLoggingBuilderExtensions.AddComponoCapture`; internal
+ `ComponoLogCollectorProvider`/`ComponoLogCollectorLogger` with
+ `ISupportExternalScope`; `AtLevelOrAbove` + `InCategory` on
+ `LogVerificationBuilder` via the internal `ILogEntrySource` seam.
+ Registration is idempotent per collector instance without
+ `TryAddEnumerable`, so two distinct collectors on one builder each get
+ a provider.
+ - `ProviderAliasAttribute` availability correction: it is in
+ `Logging.Abstractions` only for net10.0/net11.0, not net8.0/net9.0.
+ The attribute is compiled under `#if NET10_0_OR_GREATER`, the shipped
+ dependency graph is unchanged, and the alias config rule is tested
+ only on net10/net11. Recorded as ADR-0071 Amendment 1 (2026-11-11).
+ - Tests: `test/Compono.Logging.Tests` 514 passed / 0 failed across
+ net8.0/net9.0/net10.0/net11.0. New coverage: MEL category parity
+ against a real `LoggerFactory` probe (including nested, closed and
+ multi-argument generics, global-namespace, built-in and array
+ categories), equality regression for `Category`, both new filters and
+ their failure text, the provider's fallback scope source, real Generic
+ Host capture (arbitrary/container categories, host lifetime, every
+ entry field, `[LoggerMessage]`, scopes across `await`, sibling-task
+ isolation, activity scopes), host filtering (default
+ Information minimum, `SetMinimumLevel`, `AddFilter`, net10+ alias),
+ cardinality, disposal (post-dispose loggers disabled, entries remain
+ readable, `Clear` still works, double dispose safe, two-host
+ independence), isolation, and bounded concurrency (including multi-category
+ writes racing reads and clears).
+ - Validation (B7): `dotnet build Compono.slnx -c Release` 0 warnings /
+ 0 errors; `dotnet test Compono.slnx -c Release --no-build` 7057
+ total, 0 failed, 6556 succeeded, 501 skipped.
+ - AOT (V3 logging leg): pack-and-publish `net10.0`/`osx-arm64`
+ `PublishAot=true` binary passed, host-wide capture and category
+ parity assertions included, and the publish emitted zero IL2xxx/
+ IL3xxx warnings. `verify-packaging.sh` passed.
+ - ApiCompat (V6): packed `Compono.Logging` against
+ `1.4.0-preview.125` (current nuget.org latest) with no `CP` errors;
+ only additions. Packed nuspec dependency groups are identical to that
+ baseline package's groups (V7), and
+ `inspect-packed-nupkgs.tests.sh` passed.
+ - API reference regenerated with `.github/scripts/generate-api-reference.sh`;
+ post-generation status contains only the intended new/changed
+ `Compono.Logging` pages. Skill validation: `evals.json` parses (62
+ evals) and skill-creator `quick_validate.py` reports "Skill is valid!".
+ - Docs: `docs/packages/compono-logging.md` host-wide section (Category,
+ filters, host filtering, separate destinations, ownership/cardinality,
+ activity scopes, intentional equality change);
+ `docs/how-to/assert-nothing-logged-at-error-across-a-host.md` (nav +
+ index + documentation architecture); troubleshooting entries for
+ host `ILogger` `Verify()` and missing Debug entries;
+ `skills/compono/references/logging.md` + `SKILL.md`; two new evals.
+ - PR 2: #177 (`feat/164-host-wide-log-capture`). Release-note line for the
+ v1.4.0 draft author (not edited here):
+ "`Compono.Logging`: `CapturedLogEntry` equality now includes the new
+ `Category` property. This is a behavioral change to value equality,
+ not a source or binary breaking change."
+ - Acceptance criteria cross-check for #164:
+
+ | # | Criterion | Evidence |
+ |---|---|---|
+ | 1 | Host-created loggers of any category captured | `HostLogCaptureTests` arbitrary/container/lifetime categories; AOT host smoke |
+ | 2 | Category + existing fields exposed | `CapturedLogEntry.Category`; `HostLogCaptureTests` field assertions |
+ | 3 | Existing `Verify()` vocabulary + level threshold | `AtLevelOrAbove`/`InCategory` tests; headline Generic Host test |
+ | 4 | Composed capture unchanged | Existing suite unchanged; category parity and separation tests |
+ | 5 | Host/composed relationship documented | ADR-0071; package doc "Host vs. composed"; logging skill |
+ | 6 | No new package dependency | `Compono.Logging.csproj` unchanged; packed dependency groups identical |
+ | 7 | Native AOT/trimming retained | `IsAotCompatible` unchanged; AOT smoke publish zero IL warnings |
+- 2026-11-11 (independent review follow-up, PR #177): addressed review
+ findings by fixing the test csproj comment placement and stale amendment
+ count, marking the provider scope field `volatile`, documenting the
+ deliberate `!` uses in `LoggerCategoryName`, renaming the alias test to
+ describe what it proves, and adding tests for the provider fallback scope
+ source, multi-argument generic and nested global-namespace categories,
+ `InCategory("")` on a bare logger, and multi-category writes racing reads
+ and clears. Re-ran focused logging tests (514 passed/0 failed per TFM),
+ full build 0/0, full suite 7057 total/0 failed, and the AOT logging leg
+ (PASS, zero IL warnings).
+
+- 2026-11-11 (independent review remediation, PR #177): a second review round
+ raised seven findings; disposition below. Nothing here is merged yet — PR
+ #177 is still open for maintainer review.
+
+ - **F1 — confirmed registration defect (fixed).** Registering a collector,
+ calling `ClearProviders()`, then registering the *same* collector silently
+ stopped capturing: the old per-collector guard relied on a separate
+ registration-marker descriptor that `ClearProviders()` does not remove, so
+ the re-registration was treated as a duplicate while its provider was gone.
+ Fix: `ComponoCaptureRegistration` is no longer a standalone marker service;
+ it now exposes an instance method whose delegate target *is* the live
+ registration, and `IsAlreadyRegistered` scans the current
+ `ILoggerProvider` descriptors for that factory target (identity by
+ collector reference). Regression tests added to
+ `test/Compono.Logging.Tests/LogCollectorRegistrationTests.cs`:
+ `ClearProvidersThenReRegisteringTheSameCollector_StillCaptures`,
+ `ClearProvidersThenReRegisteringTwice_StaysIdempotent`,
+ `ClearProvidersThenRegisteringADifferentCollector_OnlyTheNewCollectorCaptures`,
+ `SameCollectorOnIndependentServiceCollections_IsNotTreatedAsADuplicate`.
+ - **F2 — provider-alias availability (fixed, ADR-0071 Amendment 2).** The
+ `Compono` provider alias was unavailable on net8.0/net9.0 because
+ `ProviderAliasAttribute` only exists in `Logging.Abstractions` for
+ net10.0+. The attribute is now applied unconditionally and an internal
+ same-full-name copy (`src/Compono.Logging/ProviderAliasAttribute.cs`, under
+ `#if !NET10_0_OR_GREATER`) is compiled for the older TFMs; MEL resolves the
+ alias by full type name, so the copy is honored. No new package
+ dependencies; `CS0436` is promoted to an error in
+ `Compono.Logging.csproj` so a consumer-visible type collision cannot slip
+ through. Recorded as ADR-0071 Amendment 2 (2026-11-11); Amendment 1's
+ historical text is unchanged.
+ - **F3/F4/F5/F6 — documentation corrections.** `InCategory` is exact
+ ordinal full-type-name matching, *not* prefix matching like `AddFilter`
+ (so `.InCategory("Payments")` matches nothing in a real host; use
+ `.Matching(e => e.Category.StartsWith(...))` for namespaces). `Never()`'s
+ failure message names the filters and match count but does **not** include
+ the matching entries. A shared `WebApplicationFactory` collector retains
+ entries across tests until explicitly cleared. A third-party
+ `ILoggerFactory` replacement (or a post-registration `ClearProviders()`)
+ can bypass the registered `ILoggerProvider`s and yield an empty capture.
+ Updated `docs/packages/compono-logging.md`,
+ `docs/how-to/assert-nothing-logged-at-error-across-a-host.md`,
+ `docs/troubleshooting/common-errors.md` + `index.md`,
+ `skills/compono/references/logging.md`, and evals #63/#64.
+ - **F7 — deferred.** AOT warnings are not universally promoted to errors in
+ this repo (a pre-existing repo-wide policy gap, not specific to this PR).
+ Left out of scope here.
+ - Validation: `dotnet build Compono.slnx -c Release` 0 warnings/0 errors;
+ full suite green (7087 total, 0 failed, 6586 succeeded, 501 skipped) with
+ the focused logging suite at 544/0. ApiCompat (V6): `Compono.Logging`
+ packs against the `1.4.0-preview.125` baseline with no `CP` errors
+ (additions only). V7 packed-nupkg inspection passes and the packed
+ dependency groups are unchanged. Pack-and-consume (F2): a multi-target
+ (`net8.0;net9.0;net10.0;net11.0`) consumer restored from a local feed
+ packed from this worktree (sha512 verified) builds 0/0 with `CS0436`/
+ `CS0104` as errors and runs on every TFM — `Logging:Compono:LogLevel:Default`
+ filters the Compono provider, an unrelated provider is unaffected, and a
+ consumer-defined `ProviderAliasAttribute` use compiles unambiguously.
+ AOT for the net8.0/net9.0 legs (not covered by CI's net10.0-only publish)
+ was verified locally: `PublishAot` osx-arm64 binaries built with zero
+ IL2xxx/IL3xxx warnings and ran, honoring the alias.
+
+- 2026-11-11 (review round 2 corrections, PR #177): Claude's second read-only
+ review approved with two non-blocking follow-ups, both addressed. Still open
+ for maintainer review; not merged.
+
+ - Capture sanity-check docs: `logs.Verify().InCategory("Microsoft.Hosting.Lifetime").AtLeast(1)`
+ is only valid for a Generic Host running its default lifetime. Under a
+ `WebApplicationFactory`/ASP.NET Core `TestHost` it is unreliable (different
+ host lifetime, and a shared fixture may clear startup entries between
+ tests), so it can fail even when capture is wired correctly. The
+ recommendation is now host-aware: keep the `Microsoft.Hosting.Lifetime`
+ assertion for a Generic Host, but for `WebApplicationFactory` assert a
+ deterministic application-owned entry emitted during the operation under
+ test. Updated the how-to, package guide, troubleshooting entry, and skill
+ logging reference; sharpened eval #63 and added eval #65.
+ - Keyed-provider regression: added
+ `KeyedProviderDescriptorPresent_DoesNotBreakRegistrationOrCapture` (a keyed
+ `ILoggerProvider` plus `AddComponoCapture` must still capture and must not
+ throw) and verified it on net8.0/net9.0/net10.0/net11.0. While proving it,
+ found the `IsAlreadyRegistered` comment was wrong: on supported runtimes a
+ keyed descriptor's `ImplementationFactory` is `null`, not throwing (it is
+ `KeyedImplementationFactory` that throws on a non-keyed descriptor), so the
+ `!IsKeyedService` guard is defense in depth rather than a throw guard. The
+ guard stays; its comment and the test comment were corrected to match.
+ - Validation: `dotnet build Compono.slnx -c Release` 0/0; `test/Compono.Logging.Tests`
+ 548 passed/0 failed (137 per TFM); full suite 7091 total/0 failed/6590
+ succeeded/501 skipped; `mkdocs build --clean --strict` exit 0; API reference
+ no drift; `evals.json` parses (65 evals) and `quick_validate.py` reports
+ valid. No package/AOT-affecting change, so those gates were not re-run.
diff --git a/docs/reference/api/Compono.Logging/Compono.Logging.CapturedLogEntry.Category.md b/docs/reference/api/Compono.Logging/Compono.Logging.CapturedLogEntry.Category.md
new file mode 100644
index 00000000..1e7bfdfc
--- /dev/null
+++ b/docs/reference/api/Compono.Logging/Compono.Logging.CapturedLogEntry.Category.md
@@ -0,0 +1,18 @@
+#### [Compono\.Logging](index.md 'index')
+### [Compono\.Logging](Compono.Logging.md 'Compono\.Logging').[CapturedLogEntry](Compono.Logging.CapturedLogEntry.md 'Compono\.Logging\.CapturedLogEntry')
+
+## CapturedLogEntry\.Category Property
+
+The logger's category \- the exact string passed to
+[Microsoft\.Extensions\.Logging\.ILoggerProvider\.CreateLogger\(System\.String\)](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.iloggerprovider.createlogger#microsoft-extensions-logging-iloggerprovider-createlogger(system-string) 'Microsoft\.Extensions\.Logging\.ILoggerProvider\.CreateLogger\(System\.String\)') for a host\-captured entry, or the
+`LoggerFactory.CreateLogger()`\-equivalent name for a composed/directly
+constructed [CapturingLogger<T>](Compono.Logging.CapturingLogger_T_.md 'Compono\.Logging\.CapturingLogger\')\. The non\-generic [CapturingLogger](Compono.Logging.CapturingLogger.md 'Compono\.Logging\.CapturingLogger')
+\(and a bare [Microsoft\.Extensions\.Logging\.ILogger](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger 'Microsoft\.Extensions\.Logging\.ILogger')\) uses the empty string\. This is part of the record's
+value equality \(ADR\-0071's one intentional behavioral compatibility change\)\.
+
+```csharp
+public string Category { get; }
+```
+
+#### Property Value
+[System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')
\ No newline at end of file
diff --git a/docs/reference/api/Compono.Logging/Compono.Logging.CapturedLogEntry.md b/docs/reference/api/Compono.Logging/Compono.Logging.CapturedLogEntry.md
index 4469d4e7..bce7b3df 100644
--- a/docs/reference/api/Compono.Logging/Compono.Logging.CapturedLogEntry.md
+++ b/docs/reference/api/Compono.Logging/Compono.Logging.CapturedLogEntry.md
@@ -17,6 +17,7 @@ Implements [System\.IEquatable<](https://learn.microsoft.com/en-us/dotnet/api
| Properties | |
| :--- | :--- |
+| [Category](Compono.Logging.CapturedLogEntry.Category.md 'Compono\.Logging\.CapturedLogEntry\.Category') | The logger's category \- the exact string passed to [Microsoft\.Extensions\.Logging\.ILoggerProvider\.CreateLogger\(System\.String\)](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.iloggerprovider.createlogger#microsoft-extensions-logging-iloggerprovider-createlogger(system-string) 'Microsoft\.Extensions\.Logging\.ILoggerProvider\.CreateLogger\(System\.String\)') for a host\-captured entry, or the `LoggerFactory.CreateLogger()`\-equivalent name for a composed/directly constructed [CapturingLogger<T>](Compono.Logging.CapturingLogger_T_.md 'Compono\.Logging\.CapturingLogger\')\. The non\-generic [CapturingLogger](Compono.Logging.CapturingLogger.md 'Compono\.Logging\.CapturingLogger') \(and a bare [Microsoft\.Extensions\.Logging\.ILogger](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger 'Microsoft\.Extensions\.Logging\.ILogger')\) uses the empty string\. This is part of the record's value equality \(ADR\-0071's one intentional behavioral compatibility change\)\. |
| [EventId](Compono.Logging.CapturedLogEntry.EventId.md 'Compono\.Logging\.CapturedLogEntry\.EventId') | The [EventId](Compono.Logging.CapturedLogEntry.EventId.md 'Compono\.Logging\.CapturedLogEntry\.EventId') passed to the logging call\. |
| [Exception](Compono.Logging.CapturedLogEntry.Exception.md 'Compono\.Logging\.CapturedLogEntry\.Exception') | The exception passed to the logging call, if any\. |
| [LogLevel](Compono.Logging.CapturedLogEntry.LogLevel.md 'Compono\.Logging\.CapturedLogEntry\.LogLevel') | The level this entry was logged at\. Never [Microsoft\.Extensions\.Logging\.LogLevel\.None](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel.none 'Microsoft\.Extensions\.Logging\.LogLevel\.None') \- a [Microsoft\.Extensions\.Logging\.LogLevel\.None](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel.none 'Microsoft\.Extensions\.Logging\.LogLevel\.None') call is never captured in the first place\. |
diff --git a/docs/reference/api/Compono.Logging/Compono.Logging.ComponoLoggingBuilderExtensions.AddComponoCapture(thisMicrosoft.Extensions.Logging.ILoggingBuilder,Compono.Logging.LogCollector).md b/docs/reference/api/Compono.Logging/Compono.Logging.ComponoLoggingBuilderExtensions.AddComponoCapture(thisMicrosoft.Extensions.Logging.ILoggingBuilder,Compono.Logging.LogCollector).md
new file mode 100644
index 00000000..daad7dd0
--- /dev/null
+++ b/docs/reference/api/Compono.Logging/Compono.Logging.ComponoLoggingBuilderExtensions.AddComponoCapture(thisMicrosoft.Extensions.Logging.ILoggingBuilder,Compono.Logging.LogCollector).md
@@ -0,0 +1,34 @@
+#### [Compono\.Logging](index.md 'index')
+### [Compono\.Logging](Compono.Logging.md 'Compono\.Logging').[ComponoLoggingBuilderExtensions](Compono.Logging.ComponoLoggingBuilderExtensions.md 'Compono\.Logging\.ComponoLoggingBuilderExtensions')
+
+## ComponoLoggingBuilderExtensions\.AddComponoCapture\(this ILoggingBuilder, LogCollector\) Method
+
+Registers [collector](Compono.Logging.ComponoLoggingBuilderExtensions.AddComponoCapture(thisMicrosoft.Extensions.Logging.ILoggingBuilder,Compono.Logging.LogCollector).md#Compono.Logging.ComponoLoggingBuilderExtensions.AddComponoCapture(thisMicrosoft.Extensions.Logging.ILoggingBuilder,Compono.Logging.LogCollector).collector 'Compono\.Logging\.ComponoLoggingBuilderExtensions\.AddComponoCapture\(this Microsoft\.Extensions\.Logging\.ILoggingBuilder, Compono\.Logging\.LogCollector\)\.collector') as a Compono logging provider on
+[builder](Compono.Logging.ComponoLoggingBuilderExtensions.AddComponoCapture(thisMicrosoft.Extensions.Logging.ILoggingBuilder,Compono.Logging.LogCollector).md#Compono.Logging.ComponoLoggingBuilderExtensions.AddComponoCapture(thisMicrosoft.Extensions.Logging.ILoggingBuilder,Compono.Logging.LogCollector).builder 'Compono\.Logging\.ComponoLoggingBuilderExtensions\.AddComponoCapture\(this Microsoft\.Extensions\.Logging\.ILoggingBuilder, Compono\.Logging\.LogCollector\)\.builder')\. Every host logger's entries are then appended to the collector
+\(subject to the host's own filter rules\) and inspectable via
+[GetCapturedEntries\(\)](Compono.Logging.LogCollector.GetCapturedEntries().md 'Compono\.Logging\.LogCollector\.GetCapturedEntries\(\)')/[Verify\(\)](Compono.Logging.LogCollector.Verify().md 'Compono\.Logging\.LogCollector\.Verify\(\)')\. This never
+changes filter rules\. Registering the same collector twice is idempotent \(one provider, no
+duplicate entries\); registering distinct collectors adds one provider per collector, and each
+receives every entry\. Returns [builder](Compono.Logging.ComponoLoggingBuilderExtensions.AddComponoCapture(thisMicrosoft.Extensions.Logging.ILoggingBuilder,Compono.Logging.LogCollector).md#Compono.Logging.ComponoLoggingBuilderExtensions.AddComponoCapture(thisMicrosoft.Extensions.Logging.ILoggingBuilder,Compono.Logging.LogCollector).builder 'Compono\.Logging\.ComponoLoggingBuilderExtensions\.AddComponoCapture\(this Microsoft\.Extensions\.Logging\.ILoggingBuilder, Compono\.Logging\.LogCollector\)\.builder') for chaining\.
+
+```csharp
+public static Microsoft.Extensions.Logging.ILoggingBuilder AddComponoCapture(this Microsoft.Extensions.Logging.ILoggingBuilder builder, Compono.Logging.LogCollector collector);
+```
+#### Parameters
+
+
+
+`builder` [Microsoft\.Extensions\.Logging\.ILoggingBuilder](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.iloggingbuilder 'Microsoft\.Extensions\.Logging\.ILoggingBuilder')
+
+
+
+`collector` [LogCollector](Compono.Logging.LogCollector.md 'Compono\.Logging\.LogCollector')
+
+#### Returns
+[Microsoft\.Extensions\.Logging\.ILoggingBuilder](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.iloggingbuilder 'Microsoft\.Extensions\.Logging\.ILoggingBuilder')
+
+#### Exceptions
+
+[System\.ArgumentNullException](https://learn.microsoft.com/en-us/dotnet/api/system.argumentnullexception 'System\.ArgumentNullException')
+[builder](Compono.Logging.ComponoLoggingBuilderExtensions.AddComponoCapture(thisMicrosoft.Extensions.Logging.ILoggingBuilder,Compono.Logging.LogCollector).md#Compono.Logging.ComponoLoggingBuilderExtensions.AddComponoCapture(thisMicrosoft.Extensions.Logging.ILoggingBuilder,Compono.Logging.LogCollector).builder 'Compono\.Logging\.ComponoLoggingBuilderExtensions\.AddComponoCapture\(this Microsoft\.Extensions\.Logging\.ILoggingBuilder, Compono\.Logging\.LogCollector\)\.builder') or
+ [collector](Compono.Logging.ComponoLoggingBuilderExtensions.AddComponoCapture(thisMicrosoft.Extensions.Logging.ILoggingBuilder,Compono.Logging.LogCollector).md#Compono.Logging.ComponoLoggingBuilderExtensions.AddComponoCapture(thisMicrosoft.Extensions.Logging.ILoggingBuilder,Compono.Logging.LogCollector).collector 'Compono\.Logging\.ComponoLoggingBuilderExtensions\.AddComponoCapture\(this Microsoft\.Extensions\.Logging\.ILoggingBuilder, Compono\.Logging\.LogCollector\)\.collector') is [null](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/null 'https://docs\.microsoft\.com/en\-us/dotnet/csharp/language\-reference/keywords/null')\.
\ No newline at end of file
diff --git a/docs/reference/api/Compono.Logging/Compono.Logging.ComponoLoggingBuilderExtensions.md b/docs/reference/api/Compono.Logging/Compono.Logging.ComponoLoggingBuilderExtensions.md
new file mode 100644
index 00000000..5e28653f
--- /dev/null
+++ b/docs/reference/api/Compono.Logging/Compono.Logging.ComponoLoggingBuilderExtensions.md
@@ -0,0 +1,19 @@
+#### [Compono\.Logging](index.md 'index')
+### [Compono\.Logging](Compono.Logging.md 'Compono\.Logging')
+
+## ComponoLoggingBuilderExtensions Class
+
+Host integration entry point \- registers a test\-owned [LogCollector](Compono.Logging.LogCollector.md 'Compono\.Logging\.LogCollector') as a logging
+provider so every host logger's output lands in it\. Named to avoid any ambiguity with
+`Microsoft.Extensions.Logging.LoggingBuilderExtensions`\. See
+docs/adr/0071\-compono\-logging\-host\-wide\-log\-capture\.md\.
+
+```csharp
+public static class ComponoLoggingBuilderExtensions
+```
+
+Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → ComponoLoggingBuilderExtensions
+
+| Methods | |
+| :--- | :--- |
+| [AddComponoCapture\(this ILoggingBuilder, LogCollector\)](Compono.Logging.ComponoLoggingBuilderExtensions.AddComponoCapture(thisMicrosoft.Extensions.Logging.ILoggingBuilder,Compono.Logging.LogCollector).md 'Compono\.Logging\.ComponoLoggingBuilderExtensions\.AddComponoCapture\(this Microsoft\.Extensions\.Logging\.ILoggingBuilder, Compono\.Logging\.LogCollector\)') | Registers [collector](Compono.Logging.ComponoLoggingBuilderExtensions.AddComponoCapture(thisMicrosoft.Extensions.Logging.ILoggingBuilder,Compono.Logging.LogCollector).md#Compono.Logging.ComponoLoggingBuilderExtensions.AddComponoCapture(thisMicrosoft.Extensions.Logging.ILoggingBuilder,Compono.Logging.LogCollector).collector 'Compono\.Logging\.ComponoLoggingBuilderExtensions\.AddComponoCapture\(this Microsoft\.Extensions\.Logging\.ILoggingBuilder, Compono\.Logging\.LogCollector\)\.collector') as a Compono logging provider on [builder](Compono.Logging.ComponoLoggingBuilderExtensions.AddComponoCapture(thisMicrosoft.Extensions.Logging.ILoggingBuilder,Compono.Logging.LogCollector).md#Compono.Logging.ComponoLoggingBuilderExtensions.AddComponoCapture(thisMicrosoft.Extensions.Logging.ILoggingBuilder,Compono.Logging.LogCollector).builder 'Compono\.Logging\.ComponoLoggingBuilderExtensions\.AddComponoCapture\(this Microsoft\.Extensions\.Logging\.ILoggingBuilder, Compono\.Logging\.LogCollector\)\.builder')\. Every host logger's entries are then appended to the collector \(subject to the host's own filter rules\) and inspectable via [GetCapturedEntries\(\)](Compono.Logging.LogCollector.GetCapturedEntries().md 'Compono\.Logging\.LogCollector\.GetCapturedEntries\(\)')/[Verify\(\)](Compono.Logging.LogCollector.Verify().md 'Compono\.Logging\.LogCollector\.Verify\(\)')\. This never changes filter rules\. Registering the same collector twice is idempotent \(one provider, no duplicate entries\); registering distinct collectors adds one provider per collector, and each receives every entry\. Returns [builder](Compono.Logging.ComponoLoggingBuilderExtensions.AddComponoCapture(thisMicrosoft.Extensions.Logging.ILoggingBuilder,Compono.Logging.LogCollector).md#Compono.Logging.ComponoLoggingBuilderExtensions.AddComponoCapture(thisMicrosoft.Extensions.Logging.ILoggingBuilder,Compono.Logging.LogCollector).builder 'Compono\.Logging\.ComponoLoggingBuilderExtensions\.AddComponoCapture\(this Microsoft\.Extensions\.Logging\.ILoggingBuilder, Compono\.Logging\.LogCollector\)\.builder') for chaining\. |
diff --git a/docs/reference/api/Compono.Logging/Compono.Logging.LogCollector.ClearCapturedEntries().md b/docs/reference/api/Compono.Logging/Compono.Logging.LogCollector.ClearCapturedEntries().md
new file mode 100644
index 00000000..995969be
--- /dev/null
+++ b/docs/reference/api/Compono.Logging/Compono.Logging.LogCollector.ClearCapturedEntries().md
@@ -0,0 +1,11 @@
+#### [Compono\.Logging](index.md 'index')
+### [Compono\.Logging](Compono.Logging.md 'Compono\.Logging').[LogCollector](Compono.Logging.LogCollector.md 'Compono\.Logging\.LogCollector')
+
+## LogCollector\.ClearCapturedEntries\(\) Method
+
+Discards every entry captured so far\. The collector stays fully usable afterward \-
+ clearing never detaches it from a host that is still capturing into it\.
+
+```csharp
+public void ClearCapturedEntries();
+```
\ No newline at end of file
diff --git a/docs/reference/api/Compono.Logging/Compono.Logging.LogCollector.GetCapturedEntries().md b/docs/reference/api/Compono.Logging/Compono.Logging.LogCollector.GetCapturedEntries().md
new file mode 100644
index 00000000..1e65f98e
--- /dev/null
+++ b/docs/reference/api/Compono.Logging/Compono.Logging.LogCollector.GetCapturedEntries().md
@@ -0,0 +1,14 @@
+#### [Compono\.Logging](index.md 'index')
+### [Compono\.Logging](Compono.Logging.md 'Compono\.Logging').[LogCollector](Compono.Logging.LogCollector.md 'Compono\.Logging\.LogCollector')
+
+## LogCollector\.GetCapturedEntries\(\) Method
+
+Every entry captured so far, oldest first \- a snapshot, safe to read while logging
+ continues on other threads\.
+
+```csharp
+public System.Collections.Generic.IReadOnlyList GetCapturedEntries();
+```
+
+#### Returns
+[System\.Collections\.Generic\.IReadOnlyList<](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlylist-1 'System\.Collections\.Generic\.IReadOnlyList\`1')[CapturedLogEntry](Compono.Logging.CapturedLogEntry.md 'Compono\.Logging\.CapturedLogEntry')[>](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlylist-1 'System\.Collections\.Generic\.IReadOnlyList\`1')
\ No newline at end of file
diff --git a/docs/reference/api/Compono.Logging/Compono.Logging.LogCollector.GetLastCapturedEntry().md b/docs/reference/api/Compono.Logging/Compono.Logging.LogCollector.GetLastCapturedEntry().md
new file mode 100644
index 00000000..e23e8b2a
--- /dev/null
+++ b/docs/reference/api/Compono.Logging/Compono.Logging.LogCollector.GetLastCapturedEntry().md
@@ -0,0 +1,14 @@
+#### [Compono\.Logging](index.md 'index')
+### [Compono\.Logging](Compono.Logging.md 'Compono\.Logging').[LogCollector](Compono.Logging.LogCollector.md 'Compono\.Logging\.LogCollector')
+
+## LogCollector\.GetLastCapturedEntry\(\) Method
+
+The most recently captured entry, or [null](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/null 'https://docs\.microsoft\.com/en\-us/dotnet/csharp/language\-reference/keywords/null') if nothing has been
+ captured yet\.
+
+```csharp
+public System.Nullable GetLastCapturedEntry();
+```
+
+#### Returns
+[System\.Nullable<](https://learn.microsoft.com/en-us/dotnet/api/system.nullable-1 'System\.Nullable\`1')[CapturedLogEntry](Compono.Logging.CapturedLogEntry.md 'Compono\.Logging\.CapturedLogEntry')[>](https://learn.microsoft.com/en-us/dotnet/api/system.nullable-1 'System\.Nullable\`1')
\ No newline at end of file
diff --git a/docs/reference/api/Compono.Logging/Compono.Logging.LogCollector.LogCollector().md b/docs/reference/api/Compono.Logging/Compono.Logging.LogCollector.LogCollector().md
new file mode 100644
index 00000000..8fe27200
--- /dev/null
+++ b/docs/reference/api/Compono.Logging/Compono.Logging.LogCollector.LogCollector().md
@@ -0,0 +1,10 @@
+#### [Compono\.Logging](index.md 'index')
+### [Compono\.Logging](Compono.Logging.md 'Compono\.Logging').[LogCollector](Compono.Logging.LogCollector.md 'Compono\.Logging\.LogCollector')
+
+## LogCollector\(\) Constructor
+
+Creates an empty, test\-owned collector\.
+
+```csharp
+public LogCollector();
+```
\ No newline at end of file
diff --git a/docs/reference/api/Compono.Logging/Compono.Logging.LogCollector.Verify().md b/docs/reference/api/Compono.Logging/Compono.Logging.LogCollector.Verify().md
new file mode 100644
index 00000000..1eef07d2
--- /dev/null
+++ b/docs/reference/api/Compono.Logging/Compono.Logging.LogCollector.Verify().md
@@ -0,0 +1,14 @@
+#### [Compono\.Logging](index.md 'index')
+### [Compono\.Logging](Compono.Logging.md 'Compono\.Logging').[LogCollector](Compono.Logging.LogCollector.md 'Compono\.Logging\.LogCollector')
+
+## LogCollector\.Verify\(\) Method
+
+The entry point for fluent verification over this collector's entries, e\.g\.
+`logs.Verify().AtLevelOrAbove(LogLevel.Error).Never()`\.
+
+```csharp
+public Compono.Logging.LogVerificationBuilder Verify();
+```
+
+#### Returns
+[LogVerificationBuilder](Compono.Logging.LogVerificationBuilder.md 'Compono\.Logging\.LogVerificationBuilder')
\ No newline at end of file
diff --git a/docs/reference/api/Compono.Logging/Compono.Logging.LogCollector.md b/docs/reference/api/Compono.Logging/Compono.Logging.LogCollector.md
new file mode 100644
index 00000000..51b67df3
--- /dev/null
+++ b/docs/reference/api/Compono.Logging/Compono.Logging.LogCollector.md
@@ -0,0 +1,30 @@
+#### [Compono\.Logging](index.md 'index')
+### [Compono\.Logging](Compono.Logging.md 'Compono\.Logging')
+
+## LogCollector Class
+
+A test\-owned sink for host\-wide logging output\. Register one with
+[AddComponoCapture\(this ILoggingBuilder, LogCollector\)](Compono.Logging.ComponoLoggingBuilderExtensions.AddComponoCapture(thisMicrosoft.Extensions.Logging.ILoggingBuilder,Compono.Logging.LogCollector).md 'Compono\.Logging\.ComponoLoggingBuilderExtensions\.AddComponoCapture\(this Microsoft\.Extensions\.Logging\.ILoggingBuilder, Compono\.Logging\.LogCollector\)') on a host's
+[Microsoft\.Extensions\.Logging\.ILoggingBuilder](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.iloggingbuilder 'Microsoft\.Extensions\.Logging\.ILoggingBuilder'), then inspect it with
+[GetCapturedEntries\(\)](Compono.Logging.LogCollector.GetCapturedEntries().md 'Compono\.Logging\.LogCollector\.GetCapturedEntries\(\)')/[GetLastCapturedEntry\(\)](Compono.Logging.LogCollector.GetLastCapturedEntry().md 'Compono\.Logging\.LogCollector\.GetLastCapturedEntry\(\)') or verify it with
+[Verify\(\)](Compono.Logging.LogCollector.Verify().md 'Compono\.Logging\.LogCollector\.Verify\(\)') \- the same verification surface [LoggerTestingExtensions](Compono.Logging.LoggerTestingExtensions.md 'Compono\.Logging\.LoggerTestingExtensions') offers
+for a composed logger\. The collector is thread\-safe, is never disposed or reset by the host, and
+stays readable after the host is disposed\. See
+docs/adr/0071\-compono\-logging\-host\-wide\-log\-capture\.md\.
+
+```csharp
+public sealed class LogCollector
+```
+
+Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → LogCollector
+
+| Constructors | |
+| :--- | :--- |
+| [LogCollector\(\)](Compono.Logging.LogCollector.LogCollector().md 'Compono\.Logging\.LogCollector\.LogCollector\(\)') | Creates an empty, test\-owned collector\. |
+
+| Methods | |
+| :--- | :--- |
+| [ClearCapturedEntries\(\)](Compono.Logging.LogCollector.ClearCapturedEntries().md 'Compono\.Logging\.LogCollector\.ClearCapturedEntries\(\)') | Discards every entry captured so far\. The collector stays fully usable afterward \- clearing never detaches it from a host that is still capturing into it\. |
+| [GetCapturedEntries\(\)](Compono.Logging.LogCollector.GetCapturedEntries().md 'Compono\.Logging\.LogCollector\.GetCapturedEntries\(\)') | Every entry captured so far, oldest first \- a snapshot, safe to read while logging continues on other threads\. |
+| [GetLastCapturedEntry\(\)](Compono.Logging.LogCollector.GetLastCapturedEntry().md 'Compono\.Logging\.LogCollector\.GetLastCapturedEntry\(\)') | The most recently captured entry, or [null](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/null 'https://docs\.microsoft\.com/en\-us/dotnet/csharp/language\-reference/keywords/null') if nothing has been captured yet\. |
+| [Verify\(\)](Compono.Logging.LogCollector.Verify().md 'Compono\.Logging\.LogCollector\.Verify\(\)') | The entry point for fluent verification over this collector's entries, e\.g\. `logs.Verify().AtLevelOrAbove(LogLevel.Error).Never()`\. |
diff --git a/docs/reference/api/Compono.Logging/Compono.Logging.LogVerificationBuilder.AtLevelOrAbove(Microsoft.Extensions.Logging.LogLevel).md b/docs/reference/api/Compono.Logging/Compono.Logging.LogVerificationBuilder.AtLevelOrAbove(Microsoft.Extensions.Logging.LogLevel).md
new file mode 100644
index 00000000..dcf865bf
--- /dev/null
+++ b/docs/reference/api/Compono.Logging/Compono.Logging.LogVerificationBuilder.AtLevelOrAbove(Microsoft.Extensions.Logging.LogLevel).md
@@ -0,0 +1,21 @@
+#### [Compono\.Logging](index.md 'index')
+### [Compono\.Logging](Compono.Logging.md 'Compono\.Logging').[LogVerificationBuilder](Compono.Logging.LogVerificationBuilder.md 'Compono\.Logging\.LogVerificationBuilder')
+
+## LogVerificationBuilder\.AtLevelOrAbove\(LogLevel\) Method
+
+Restricts matches to entries logged at [level](Compono.Logging.LogVerificationBuilder.AtLevelOrAbove(Microsoft.Extensions.Logging.LogLevel).md#Compono.Logging.LogVerificationBuilder.AtLevelOrAbove(Microsoft.Extensions.Logging.LogLevel).level 'Compono\.Logging\.LogVerificationBuilder\.AtLevelOrAbove\(Microsoft\.Extensions\.Logging\.LogLevel\)\.level') or any more severe level
+\(e\.g\. `AtLevelOrAbove(LogLevel.Error)` matches Error and Critical\)\. A captured entry is
+never [Microsoft\.Extensions\.Logging\.LogLevel\.None](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel.none 'Microsoft\.Extensions\.Logging\.LogLevel\.None'), and neither is [Microsoft\.Extensions\.Logging\.LogLevel\.None](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel.none 'Microsoft\.Extensions\.Logging\.LogLevel\.None') ever treated as
+"above" anything, so `AtLevelOrAbove(LogLevel.None)` matches nothing\.
+
+```csharp
+public Compono.Logging.LogVerificationBuilder AtLevelOrAbove(Microsoft.Extensions.Logging.LogLevel level);
+```
+#### Parameters
+
+
+
+`level` [Microsoft\.Extensions\.Logging\.LogLevel](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel 'Microsoft\.Extensions\.Logging\.LogLevel')
+
+#### Returns
+[LogVerificationBuilder](Compono.Logging.LogVerificationBuilder.md 'Compono\.Logging\.LogVerificationBuilder')
\ No newline at end of file
diff --git a/docs/reference/api/Compono.Logging/Compono.Logging.LogVerificationBuilder.InCategory(string).md b/docs/reference/api/Compono.Logging/Compono.Logging.LogVerificationBuilder.InCategory(string).md
new file mode 100644
index 00000000..bbbb25e6
--- /dev/null
+++ b/docs/reference/api/Compono.Logging/Compono.Logging.LogVerificationBuilder.InCategory(string).md
@@ -0,0 +1,25 @@
+#### [Compono\.Logging](index.md 'index')
+### [Compono\.Logging](Compono.Logging.md 'Compono\.Logging').[LogVerificationBuilder](Compono.Logging.LogVerificationBuilder.md 'Compono\.Logging\.LogVerificationBuilder')
+
+## LogVerificationBuilder\.InCategory\(string\) Method
+
+Restricts matches to entries whose [Category](Compono.Logging.CapturedLogEntry.Category.md 'Compono\.Logging\.CapturedLogEntry\.Category') is exactly
+[category](Compono.Logging.LogVerificationBuilder.InCategory(string).md#Compono.Logging.LogVerificationBuilder.InCategory(string).category 'Compono\.Logging\.LogVerificationBuilder\.InCategory\(string\)\.category') \(ordinal, case\-sensitive \- use [Matching\(Func<CapturedLogEntry,bool>\)](Compono.Logging.LogVerificationBuilder.Matching(System.Func_Compono.Logging.CapturedLogEntry,bool_).md 'Compono\.Logging\.LogVerificationBuilder\.Matching\(System\.Func\\)') for a prefix
+or wildcard match\)\.
+
+```csharp
+public Compono.Logging.LogVerificationBuilder InCategory(string category);
+```
+#### Parameters
+
+
+
+`category` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')
+
+#### Returns
+[LogVerificationBuilder](Compono.Logging.LogVerificationBuilder.md 'Compono\.Logging\.LogVerificationBuilder')
+
+#### Exceptions
+
+[System\.ArgumentNullException](https://learn.microsoft.com/en-us/dotnet/api/system.argumentnullexception 'System\.ArgumentNullException')
+[category](Compono.Logging.LogVerificationBuilder.InCategory(string).md#Compono.Logging.LogVerificationBuilder.InCategory(string).category 'Compono\.Logging\.LogVerificationBuilder\.InCategory\(string\)\.category') is [null](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/null 'https://docs\.microsoft\.com/en\-us/dotnet/csharp/language\-reference/keywords/null')\.
\ No newline at end of file
diff --git a/docs/reference/api/Compono.Logging/Compono.Logging.LogVerificationBuilder.md b/docs/reference/api/Compono.Logging/Compono.Logging.LogVerificationBuilder.md
index 459b584e..afeb3782 100644
--- a/docs/reference/api/Compono.Logging/Compono.Logging.LogVerificationBuilder.md
+++ b/docs/reference/api/Compono.Logging/Compono.Logging.LogVerificationBuilder.md
@@ -20,8 +20,10 @@ Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system
| :--- | :--- |
| [AtLeast\(int\)](Compono.Logging.LogVerificationBuilder.AtLeast(int).md 'Compono\.Logging\.LogVerificationBuilder\.AtLeast\(int\)') | Asserts the accumulated filters matched at least [times](Compono.Logging.LogVerificationBuilder.AtLeast(int).md#Compono.Logging.LogVerificationBuilder.AtLeast(int).times 'Compono\.Logging\.LogVerificationBuilder\.AtLeast\(int\)\.times') times\. |
| [AtLevel\(LogLevel\)](Compono.Logging.LogVerificationBuilder.AtLevel(Microsoft.Extensions.Logging.LogLevel).md 'Compono\.Logging\.LogVerificationBuilder\.AtLevel\(Microsoft\.Extensions\.Logging\.LogLevel\)') | Restricts matches to entries logged at exactly [level](Compono.Logging.LogVerificationBuilder.AtLevel(Microsoft.Extensions.Logging.LogLevel).md#Compono.Logging.LogVerificationBuilder.AtLevel(Microsoft.Extensions.Logging.LogLevel).level 'Compono\.Logging\.LogVerificationBuilder\.AtLevel\(Microsoft\.Extensions\.Logging\.LogLevel\)\.level')\. |
+| [AtLevelOrAbove\(LogLevel\)](Compono.Logging.LogVerificationBuilder.AtLevelOrAbove(Microsoft.Extensions.Logging.LogLevel).md 'Compono\.Logging\.LogVerificationBuilder\.AtLevelOrAbove\(Microsoft\.Extensions\.Logging\.LogLevel\)') | Restricts matches to entries logged at [level](Compono.Logging.LogVerificationBuilder.AtLevelOrAbove(Microsoft.Extensions.Logging.LogLevel).md#Compono.Logging.LogVerificationBuilder.AtLevelOrAbove(Microsoft.Extensions.Logging.LogLevel).level 'Compono\.Logging\.LogVerificationBuilder\.AtLevelOrAbove\(Microsoft\.Extensions\.Logging\.LogLevel\)\.level') or any more severe level \(e\.g\. `AtLevelOrAbove(LogLevel.Error)` matches Error and Critical\)\. A captured entry is never [Microsoft\.Extensions\.Logging\.LogLevel\.None](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel.none 'Microsoft\.Extensions\.Logging\.LogLevel\.None'), and neither is [Microsoft\.Extensions\.Logging\.LogLevel\.None](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel.none 'Microsoft\.Extensions\.Logging\.LogLevel\.None') ever treated as "above" anything, so `AtLevelOrAbove(LogLevel.None)` matches nothing\. |
| [AtMost\(int\)](Compono.Logging.LogVerificationBuilder.AtMost(int).md 'Compono\.Logging\.LogVerificationBuilder\.AtMost\(int\)') | Asserts the accumulated filters matched at most [times](Compono.Logging.LogVerificationBuilder.AtMost(int).md#Compono.Logging.LogVerificationBuilder.AtMost(int).times 'Compono\.Logging\.LogVerificationBuilder\.AtMost\(int\)\.times') times\. |
| [Exactly\(int\)](Compono.Logging.LogVerificationBuilder.Exactly(int).md 'Compono\.Logging\.LogVerificationBuilder\.Exactly\(int\)') | Asserts the accumulated filters matched exactly [times](Compono.Logging.LogVerificationBuilder.Exactly(int).md#Compono.Logging.LogVerificationBuilder.Exactly(int).times 'Compono\.Logging\.LogVerificationBuilder\.Exactly\(int\)\.times') times\. |
+| [InCategory\(string\)](Compono.Logging.LogVerificationBuilder.InCategory(string).md 'Compono\.Logging\.LogVerificationBuilder\.InCategory\(string\)') | Restricts matches to entries whose [Category](Compono.Logging.CapturedLogEntry.Category.md 'Compono\.Logging\.CapturedLogEntry\.Category') is exactly [category](Compono.Logging.LogVerificationBuilder.InCategory(string).md#Compono.Logging.LogVerificationBuilder.InCategory(string).category 'Compono\.Logging\.LogVerificationBuilder\.InCategory\(string\)\.category') \(ordinal, case\-sensitive \- use [Matching\(Func<CapturedLogEntry,bool>\)](Compono.Logging.LogVerificationBuilder.Matching(System.Func_Compono.Logging.CapturedLogEntry,bool_).md 'Compono\.Logging\.LogVerificationBuilder\.Matching\(System\.Func\\)') for a prefix or wildcard match\)\. |
| [Matching\(Func<CapturedLogEntry,bool>\)](Compono.Logging.LogVerificationBuilder.Matching(System.Func_Compono.Logging.CapturedLogEntry,bool_).md 'Compono\.Logging\.LogVerificationBuilder\.Matching\(System\.Func\\)') | Restricts matches to entries satisfying an arbitrary [predicate](Compono.Logging.LogVerificationBuilder.Matching(System.Func_Compono.Logging.CapturedLogEntry,bool_).md#Compono.Logging.LogVerificationBuilder.Matching(System.Func_Compono.Logging.CapturedLogEntry,bool_).predicate 'Compono\.Logging\.LogVerificationBuilder\.Matching\(System\.Func\\)\.predicate') \- the escape hatch for anything the named filters above don't cover\. |
| [Never\(\)](Compono.Logging.LogVerificationBuilder.Never().md 'Compono\.Logging\.LogVerificationBuilder\.Never\(\)') | Asserts the accumulated filters never matched\. |
| [Once\(\)](Compono.Logging.LogVerificationBuilder.Once().md 'Compono\.Logging\.LogVerificationBuilder\.Once\(\)') | Asserts the accumulated filters matched exactly once\. |
diff --git a/docs/reference/api/Compono.Logging/Compono.Logging.md b/docs/reference/api/Compono.Logging/Compono.Logging.md
index 31346cc0..b2f66460 100644
--- a/docs/reference/api/Compono.Logging/Compono.Logging.md
+++ b/docs/reference/api/Compono.Logging/Compono.Logging.md
@@ -6,7 +6,9 @@
| :--- | :--- |
| [CapturingLogger](Compono.Logging.CapturingLogger.md 'Compono\.Logging\.CapturingLogger') | A hand\-written, reflection\-free [Microsoft\.Extensions\.Logging\.ILogger](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger 'Microsoft\.Extensions\.Logging\.ILogger') that captures every logged entry into an inspectable, thread\-safe, Compono\-native model \([CapturedLogEntry](Compono.Logging.CapturedLogEntry.md 'Compono\.Logging\.CapturedLogEntry')\) \- real scope tracking via [Microsoft\.Extensions\.Logging\.LoggerExternalScopeProvider](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loggerexternalscopeprovider 'Microsoft\.Extensions\.Logging\.LoggerExternalScopeProvider'), structured\-property extraction, and genuine [MinimumLevel](Compono.Logging.LoggingOptions.MinimumLevel.md 'Compono\.Logging\.LoggingOptions\.MinimumLevel') filtering\. Directly, publicly constructible \- composing through [UseLogging\(this CompositionBuilder, Action<LoggingOptions>\)](Compono.Logging.CompositionBuilderExtensions.UseLogging(thisCompono.CompositionBuilder,System.Action_Compono.Logging.LoggingOptions_).md 'Compono\.Logging\.CompositionBuilderExtensions\.UseLogging\(this Compono\.CompositionBuilder, System\.Action\\)') is not required\. See docs/adr/0055\-compono\-logging\-testing\-support\-package\.md\. |
| [CapturingLogger<T>](Compono.Logging.CapturingLogger_T_.md 'Compono\.Logging\.CapturingLogger\') | The generic counterpart to [CapturingLogger](Compono.Logging.CapturingLogger.md 'Compono\.Logging\.CapturingLogger') \- implemented once, works for every closed [Microsoft\.Extensions\.Logging\.ILogger<>](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger-1 'Microsoft\.Extensions\.Logging\.ILogger\`1'), no per\-[T](Compono.Logging.CapturingLogger_T_.md#Compono.Logging.CapturingLogger_T_.T 'Compono\.Logging\.CapturingLogger\\.T') generation needed for its own behavior\. Composes an internal `Compono.Logging.LogEntryCollector` directly rather than containing or delegating to a [CapturingLogger](Compono.Logging.CapturingLogger.md 'Compono\.Logging\.CapturingLogger') instance \(composition over inheritance, deliberately deviating from `LayeredCraft.StructuredLogging`'s `TestLogger : TestLogger` shape\)\. Directly, publicly constructible \- composing through [UseLogging\(this CompositionBuilder, Action<LoggingOptions>\)](Compono.Logging.CompositionBuilderExtensions.UseLogging(thisCompono.CompositionBuilder,System.Action_Compono.Logging.LoggingOptions_).md 'Compono\.Logging\.CompositionBuilderExtensions\.UseLogging\(this Compono\.CompositionBuilder, System\.Action\\)') is not required, and [LoggingFactoryRegistry](Compono.Logging.LoggingFactoryRegistry.md 'Compono\.Logging\.LoggingFactoryRegistry')'s generated activators call this exact same public constructor rather than a separate internal\-only path\. See docs/adr/0055\-compono\-logging\-testing\-support\-package\.md\. |
+| [ComponoLoggingBuilderExtensions](Compono.Logging.ComponoLoggingBuilderExtensions.md 'Compono\.Logging\.ComponoLoggingBuilderExtensions') | Host integration entry point \- registers a test\-owned [LogCollector](Compono.Logging.LogCollector.md 'Compono\.Logging\.LogCollector') as a logging provider so every host logger's output lands in it\. Named to avoid any ambiguity with `Microsoft.Extensions.Logging.LoggingBuilderExtensions`\. See docs/adr/0071\-compono\-logging\-host\-wide\-log\-capture\.md\. |
| [CompositionBuilderExtensions](Compono.Logging.CompositionBuilderExtensions.md 'Compono\.Logging\.CompositionBuilderExtensions') | Registers [Compono\.Logging](Compono.Logging.md 'Compono\.Logging') support into a [CompositionBuilder](../Compono/Compono.CompositionBuilder.md 'Compono\.CompositionBuilder')\. |
+| [LogCollector](Compono.Logging.LogCollector.md 'Compono\.Logging\.LogCollector') | A test\-owned sink for host\-wide logging output\. Register one with [AddComponoCapture\(this ILoggingBuilder, LogCollector\)](Compono.Logging.ComponoLoggingBuilderExtensions.AddComponoCapture(thisMicrosoft.Extensions.Logging.ILoggingBuilder,Compono.Logging.LogCollector).md 'Compono\.Logging\.ComponoLoggingBuilderExtensions\.AddComponoCapture\(this Microsoft\.Extensions\.Logging\.ILoggingBuilder, Compono\.Logging\.LogCollector\)') on a host's [Microsoft\.Extensions\.Logging\.ILoggingBuilder](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.iloggingbuilder 'Microsoft\.Extensions\.Logging\.ILoggingBuilder'), then inspect it with [GetCapturedEntries\(\)](Compono.Logging.LogCollector.GetCapturedEntries().md 'Compono\.Logging\.LogCollector\.GetCapturedEntries\(\)')/[GetLastCapturedEntry\(\)](Compono.Logging.LogCollector.GetLastCapturedEntry().md 'Compono\.Logging\.LogCollector\.GetLastCapturedEntry\(\)') or verify it with [Verify\(\)](Compono.Logging.LogCollector.Verify().md 'Compono\.Logging\.LogCollector\.Verify\(\)') \- the same verification surface [LoggerTestingExtensions](Compono.Logging.LoggerTestingExtensions.md 'Compono\.Logging\.LoggerTestingExtensions') offers for a composed logger\. The collector is thread\-safe, is never disposed or reset by the host, and stays readable after the host is disposed\. See docs/adr/0071\-compono\-logging\-host\-wide\-log\-capture\.md\. |
| [LoggerTestingExtensions](Compono.Logging.LoggerTestingExtensions.md 'Compono\.Logging\.LoggerTestingExtensions') | Direct inspection and fluent verification over any [Microsoft\.Extensions\.Logging\.ILogger](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger 'Microsoft\.Extensions\.Logging\.ILogger') \- no assertion framework required\. Every method here requires the [Microsoft\.Extensions\.Logging\.ILogger](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger 'Microsoft\.Extensions\.Logging\.ILogger') it's called on to actually be a [Compono\.Logging](Compono.Logging.md 'Compono\.Logging') capturing logger \(produced by [UseLogging\(this CompositionBuilder, Action<LoggingOptions>\)](Compono.Logging.CompositionBuilderExtensions.UseLogging(thisCompono.CompositionBuilder,System.Action_Compono.Logging.LoggingOptions_).md 'Compono\.Logging\.CompositionBuilderExtensions\.UseLogging\(this Compono\.CompositionBuilder, System\.Action\\)'), or directly via [CapturingLogger](Compono.Logging.CapturingLogger.md 'Compono\.Logging\.CapturingLogger')/[CapturingLogger<T>](Compono.Logging.CapturingLogger_T_.md 'Compono\.Logging\.CapturingLogger\')'s public constructors\) \- calling any of these against [Microsoft\.Extensions\.Logging\.Abstractions\.NullLogger<>](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.abstractions.nulllogger-1 'Microsoft\.Extensions\.Logging\.Abstractions\.NullLogger\`1'), an NSubstitute substitute, a `Compono.TestDoubles`\-generated double, or any other non\-Compono\.Logging [Microsoft\.Extensions\.Logging\.ILogger](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger 'Microsoft\.Extensions\.Logging\.ILogger') throws immediately, diagnostically, rather than returning an empty/default result\. See docs/adr/0055\-compono\-logging\-testing\-support\-package\.md's "Failure semantics for a non\-Compono\.Logging ILogger" section\. |
| [LoggingFactoryRegistry](Compono.Logging.LoggingFactoryRegistry.md 'Compono\.Logging\.LoggingFactoryRegistry') | A [System\.Type](https://learn.microsoft.com/en-us/dotnet/api/system.type 'System\.Type')\-keyed registry of statically\-closed [CapturingLogger<T>](Compono.Logging.CapturingLogger_T_.md 'Compono\.Logging\.CapturingLogger\') activators, populated by a `[ModuleInitializer]` the shared `Compono.Generators` analyzer emits per discovered closed `ILogger` category \- never by this type itself\. `Compono.Logging` ships no analyzer/generator DLL of its own \(ADR\-0055 Amendment 3\)\. |
| [LoggingOptions](Compono.Logging.LoggingOptions.md 'Compono\.Logging\.LoggingOptions') | Configuration for [UseLogging\(this CompositionBuilder, Action<LoggingOptions>\)](Compono.Logging.CompositionBuilderExtensions.UseLogging(thisCompono.CompositionBuilder,System.Action_Compono.Logging.LoggingOptions_).md 'Compono\.Logging\.CompositionBuilderExtensions\.UseLogging\(this Compono\.CompositionBuilder, System\.Action\\)') and for directly constructing a [CapturingLogger](Compono.Logging.CapturingLogger.md 'Compono\.Logging\.CapturingLogger')/[CapturingLogger<T>](Compono.Logging.CapturingLogger_T_.md 'Compono\.Logging\.CapturingLogger\')\. Fixed at construction time \- there is no runtime\-mutable equivalent, unlike `LayeredCraft.StructuredLogging`'s `TestLogger.MinimumLogLevel` setter\. See docs/adr/0055\-compono\-logging\-testing\-support\-package\.md\. |
diff --git a/docs/troubleshooting/common-errors.md b/docs/troubleshooting/common-errors.md
index ac3cbed5..10702f89 100644
--- a/docs/troubleshooting/common-errors.md
+++ b/docs/troubleshooting/common-errors.md
@@ -292,6 +292,69 @@ and never a `CMP` code — for four distinct situations:
'...', which is not a '...'.`** — the lookup returned a value of the wrong
type (only possible with a non-xUnit `ITestContext` implementation).
+### "`Verify()` on a host `ILogger` throws"
+
+A logger resolved from a host's `IServiceProvider` is the host's own
+`ILogger` implementation, not a Compono capturing logger. `Verify()` and
+the other `LoggerTestingExtensions` members require a logger produced by
+`UseLogging()` or a directly constructed `CapturingLogger`/
+`CapturingLogger`, so they throw:
+
+```text
+'Microsoft.Extensions.Logging.Logger<...>' is not a Compono.Logging capturing logger. ...
+```
+
+Host-wide capture is a **separate destination** from per-logger capture in
+v1: register a `LogCollector` on the host's logging pipeline with
+`AddComponoCapture()`, then call `Verify()`/`GetCapturedEntries()` on the
+collector instead of on the host logger. See
+[Host-wide capture](../packages/compono-logging.md#host-wide-capture-with-logcollector-and-addcomponocapture)
+and [How Do I Assert Nothing Logged at Error or Above Across a Generic
+Host?](../how-to/assert-nothing-logged-at-error-across-a-host.md).
+
+### "Debug entries are missing from `LogCollector`"
+
+The collector does not override the host's filter rules. A Generic Host's
+default minimum level is `Information`, so `Debug` and `Trace` entries are
+filtered out before they reach any provider, including Compono's. Lower the
+host minimum when the test needs them:
+
+```csharp
+builder.Logging.SetMinimumLevel(LogLevel.Trace);
+```
+
+The same happens when a configured category rule or `AddFilter` excludes
+the category. To target only the Compono provider, use its `Compono`
+alias, for example `Logging:Compono:LogLevel:Default` — this works on every
+supported target framework.
+
+### "`Never()` passes but the host clearly logged an error"
+
+`Never()` passes whenever no captured entry matches, including when the
+filter matches nothing or the collector captured nothing at all:
+
+- **`InCategory` was given a prefix or short name.** It is an exact match
+ on the full category (normally the `ILogger` type's full name), unlike
+ `AddFilter`/`Logging:LogLevel:*` rules, which match by prefix. Use the
+ full name, or
+ `.Matching(entry => entry.Category.StartsWith("MyApp.Payments.", StringComparison.Ordinal))`.
+- **The host replaced `ILoggerFactory`.** A logging library that swaps in
+ its own factory and ignores registered providers — for example Serilog's
+ `UseSerilog()` without `writeToProviders: true` — never calls the
+ Compono provider.
+- **The provider was removed after registration.** Application code that
+ calls `ClearProviders()` after the test's `AddComponoCapture` removes it.
+ Register the collector after that code runs (for `WebApplicationFactory`,
+ in `ConfigureWebHost`).
+
+Check that the collector captured something a host of this kind logs. On a
+Generic Host with its default lifetime,
+`logs.Verify().InCategory("Microsoft.Hosting.Lifetime").AtLeast(1)` after
+`StartAsync` confirms capture. Under a `WebApplicationFactory`/ASP.NET Core
+`TestHost`, assert a deterministic entry your own code emits during the
+operation under test instead — `TestHost` runs a different host lifetime,
+and a shared fixture may clear startup entries between tests.
+
### "Two composed parameters of the same type aren't the same instance"
That's the default — composition is independent per parameter unless you
diff --git a/docs/troubleshooting/index.md b/docs/troubleshooting/index.md
index 28e7410e..2b98f9c0 100644
--- a/docs/troubleshooting/index.md
+++ b/docs/troubleshooting/index.md
@@ -10,6 +10,10 @@ than reading top to bottom.
- **A test throws `CompositionException`/`CompositionConfigurationException`
at runtime**, with no `CMP` code → [Common Errors: Runtime Composition
Failures](common-errors.md#runtime-composition-failures).
+- **A `LogCollector` assertion doesn't see entries you expected** (a host
+ `ILogger` throws from `Verify()`, `Debug`/`Trace` entries are
+ missing, or `Never()` passes although the host logged an error) →
+ [Common Errors: Host-wide logging](common-errors.md#verify-on-a-host-iloggert-throws).
- **Something works but doesn't behave the way you expected** (a value
looks wrong, a substitute doesn't do what you thought, a value isn't
shared) → [FAQ](faq.md).
diff --git a/mkdocs.yml b/mkdocs.yml
index b0822073..d561540b 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -132,6 +132,7 @@ nav:
- Register a Type: how-to/register-a-type.md
- Use Profiles: how-to/use-profiles.md
- Share a Value Across a Test: how-to/share-a-value-across-a-test.md
+ - Assert Nothing Logged at Error or Above Across a Host: how-to/assert-nothing-logged-at-error-across-a-host.md
- Cookbook: cookbook/index.md
- Samples:
- Overview: samples/index.md
diff --git a/skills/compono/SKILL.md b/skills/compono/SKILL.md
index c6823c6c..c4900461 100644
--- a/skills/compono/SKILL.md
+++ b/skills/compono/SKILL.md
@@ -52,7 +52,7 @@ some packages and not others.
| `true` set (check separately; its absence is the most common setup mistake, not a reason to skip loading the reference) |
| `` compose via `UseLogging()`, `CapturingLogger`/`CapturingLogger`, `Verify()` available — load `references/logging.md`. Generation is on by default once the package is referenced — never suggest a manual MSBuild opt-in step |
+| `` compose via `UseLogging()`, `CapturingLogger`/`CapturingLogger`, `Verify()` available; host-wide capture via `LogCollector`/`AddComponoCapture` — load `references/logging.md`. Generation is on by default once the package is referenced — never suggest a manual MSBuild opt-in step |
| ``/`UseOptions()` available — load `references/options.md` |
| `Composer.Create(`, `.Create<`, `.CreateMany<`, `CompositionBuilder` | `*.cs` | High | Core Compono API in active use |
| `[Compose]`, `[Compose<...>]`, `[ComposeData]`, `[Shared]` | `*.cs` | High | `Compono.XunitV3`, `Compono.TUnit`, `Compono.MSTest`, or `Compono.NUnit` attributes in active use - check which package is referenced before assuming which |
@@ -497,6 +497,6 @@ Load only what the Detection table says is relevant to the current task.
| `references/testdoubles.md` | `Compono.TestDoubles` is referenced or `UseGeneratedTestDoubles()` is called — `UseGeneratedTestDoubles()`/generated `Configure()`/`Verify()` work, `Match` matching, `ReturnsCallback(...)`, and multiple responses for eligible members, including diagnosing a missing `ComponoGeneratedTestDoubles` opt-in |
| `references/dependencyinjection.md` | `Compono.DependencyInjection` is referenced or `.AsServiceProvider()` is called — `row.AsServiceProvider()`, its stable-identity/caching contract, and what it deliberately can't resolve |
| `references/http.md` | `Compono.Http` is referenced — `TestHttpHandler`/matching/verification/lifetime work |
-| `references/logging.md` | `Compono.Logging` is referenced or `UseLogging()` is called — `ILogger`/`ILogger` composition, `CapturingLogger`/`CapturingLogger`, structured properties, scope semantics, `Verify()`, and the `ComponoGeneratedLogging` default-on/opt-out behavior |
+| `references/logging.md` | `Compono.Logging` is referenced or `UseLogging()` is called — `ILogger`/`ILogger` composition, `CapturingLogger`/`CapturingLogger`, structured properties, scope semantics, `Verify()`, host-wide capture (`LogCollector`/`AddComponoCapture`, `Category`, `AtLevelOrAbove`/`InCategory`, host-vs-composed boundaries), and the `ComponoGeneratedLogging` default-on/opt-out behavior |
| `references/options.md` | `Compono.Options` is referenced or `UseOptions(` is called — `TestOptionsSource`/`UseOptions()` identity model, named options, the unconfigured-name diagnostic, `IConfiguration`-vs-`Compono.Options` routing, and the Finding B boundary |
| `references/patterns-and-antipatterns.md` | Reviewing existing Compono usage for correctness, migrating from AutoFixture, or unsure whether an approach is idiomatic |
diff --git a/skills/compono/evals/evals.json b/skills/compono/evals/evals.json
index ef98d672..31c2b041 100644
--- a/skills/compono/evals/evals.json
+++ b/skills/compono/evals/evals.json
@@ -754,6 +754,75 @@
"Does not try to read the fixture in a static initializer or at discovery time",
"Does not pass a fixture-owned IDisposable as a theory argument (the JIT xUnit engine would dispose the fixture's instance); does not imply the concern is missing automatic cleanup"
]
+ },
+ {
+ "id": 61,
+ "category": "activation",
+ "prompt": "My test starts the real app with Host.CreateApplicationBuilder and runs its startup path. I want to assert that nothing at Error or above was logged anywhere during startup, including framework categories I never composed. How do I do that with Compono.Logging?",
+ "expected_output": "Create a test-owned LogCollector, register it with builder.Logging.AddComponoCapture(logs) (optionally after ClearProviders), build/start the host, then assert logs.Verify().AtLevelOrAbove(LogLevel.Error).Never(). Verify on the collector, not on a composed logger - host-wide and composed capture are separate destinations in this release. The host's own filters still apply: with the default minimum Information, Debug/Trace are not captured (lower it with SetMinimumLevel/AddFilter if needed). Do not use FakeLogCollector/Microsoft.Extensions.Diagnostics.Testing, and do not propose forwarding host output into a composed logger.",
+ "files": [],
+ "expectations": [
+ "Creates a LogCollector and registers it via AddComponoCapture on the host's ILoggingBuilder",
+ "Asserts with collector.Verify().AtLevelOrAbove(LogLevel.Error).Never() (not a composed logger's Verify())",
+ "Explains host and composed capture are separate destinations in this release",
+ "Notes the host's filter minimum still applies, so Debug/Trace need SetMinimumLevel/AddFilter to be captured",
+ "Does not reach for FakeLogCollector, Microsoft.Extensions.Diagnostics.Testing, or a reflection-based capture hack"
+ ]
+ },
+ {
+ "id": 62,
+ "category": "behavioral-correctness",
+ "prompt": "Compono.Logging is referenced and UseLogging() works for my composed types, but when I resolve ILogger from host.Services and call logger.Verify(), it throws InvalidOperationException. Why, and what should I do instead?",
+ "expected_output": "An ILogger resolved from a real host's IServiceProvider is the host's own Logger, not a Compono CapturingLogger, so the CapturingLogger facade (and Verify()/GetCapturedEntries()) is unavailable. In this release host-wide capture and composed capture are separate: register a test-owned LogCollector with AddComponoCapture() on the host's logging builder and verify/read through the collector (e.g. logs.Verify().InCategory(...)); the exception message points there. Do not suggest UseLogging() on the host, casting/unwrapping the logger, or forwarding host output into a composed logger - none of those exist.",
+ "files": [],
+ "expectations": [
+ "Explains the host-resolved ILogger is the host's Logger, not a Compono capturing logger, so Verify() cannot work on it",
+ "Points to LogCollector + AddComponoCapture as the host-wide capture mechanism",
+ "States host-wide and composed capture are separate destinations, with no forwarding in this release",
+ "Does not suggest registering UseLogging() on the host, casting/unwrapping the host logger, or a nonexistent forwarding option",
+ "Does not claim host-wide capture is unsupported"
+ ]
+ },
+ {
+ "id": 63,
+ "category": "behavioral-correctness",
+ "prompt": "I registered a LogCollector with AddComponoCapture on my Generic Host. My services live in the MyApp.Payments namespace (for example ILogger). I wrote logs.Verify().AtLevelOrAbove(LogLevel.Error).InCategory(\"MyApp.Payments\").Never() and it passes, but I can see PaymentGateway logging errors. Why, and how should I assert no errors from anything in that namespace?",
+ "expected_output": "InCategory is an exact, ordinal, case-sensitive match on CapturedLogEntry.Category, and a host ILogger's category is the type's full name (MyApp.Payments.PaymentGateway), so InCategory(\"MyApp.Payments\") matches no entry and Never() passes without checking anything. This differs from the host's own AddFilter/Logging:LogLevel rules, which match by category prefix. Use the full category name for one logger, or for a namespace use Matching(entry => entry.Category.StartsWith(\"MyApp.Payments.\", StringComparison.Ordinal)).Never(). Optionally add a sanity assertion that the collector captured a known entry, so a match-nothing filter can't pass silently - on a Generic Host with its default lifetime that can be the Microsoft.Hosting.Lifetime \"Application started\" entry after StartAsync, but under a WebApplicationFactory/ASP.NET Core TestHost it should be a deterministic entry the code under test emits (TestHost runs a different host lifetime and a shared fixture may clear startup entries between tests).",
+ "files": [],
+ "expectations": [
+ "Explains InCategory is an exact match, not a prefix match, so a namespace string matches nothing",
+ "Explains Never() therefore passes without checking anything",
+ "Contrasts this with AddFilter/configuration category rules, which match by prefix",
+ "Recommends the full category name for one logger, or Matching(entry => entry.Category.StartsWith(...)) for a namespace",
+ "Does not claim InCategory supports wildcards or prefixes, and does not invent a new filter method"
+ ]
+ },
+ {
+ "id": 64,
+ "category": "behavioral-correctness",
+ "prompt": "My test project targets net8.0 and references Compono.Logging. I want my LogCollector to see Debug entries without changing what my other logging providers receive. Can I use a Logging:Compono configuration rule on net8.0, or is that .NET 10+ only?",
+ "expected_output": "Yes - the Compono provider is registered under the Compono alias on every supported target framework (net8.0 through net11.0), so a rule such as Logging:Compono:LogLevel:Default = Debug (plus a global minimum low enough for Debug to reach the providers, or a per-provider rule) applies only to the Compono provider. It is not .NET 10+ only. AddComponoCapture itself never changes filter rules; the host's LoggerFilterOptions decides what reaches the collector.",
+ "files": [],
+ "expectations": [
+ "States the Logging:Compono provider-alias rule works on net8.0 (every supported TFM), not only on .NET 10+",
+ "Shows a Logging:Compono:LogLevel configuration rule targeting only the Compono provider",
+ "States AddComponoCapture does not change filter rules - the host's filter configuration decides what is captured",
+ "Does not suggest referencing the internal provider type name or adding a dependency to get the alias"
+ ]
+ },
+ {
+ "id": 65,
+ "category": "behavioral-correctness",
+ "prompt": "My WebApplicationFactory test registers a LogCollector with AddComponoCapture and asserts factory.Logs.Verify().AtLevelOrAbove(LogLevel.Error).Never(). To make sure capture is actually wired up, I added factory.Logs.Verify().InCategory(\"Microsoft.Hosting.Lifetime\").AtLeast(1) first, but it fails even though the app is clearly logging. Is that the right sanity check?",
+ "expected_output": "Not under WebApplicationFactory. ASP.NET Core TestHost runs a different host lifetime than a Generic Host, and a shared fixture may clear startup entries between tests, so Microsoft.Hosting.Lifetime (and other framework startup logging) is not a reliable sanity check there. Prefer asserting a deterministic entry the code under test emits during the operation under test - for example factory.Logs.Verify().Matching(entry => entry.Message.Contains(\"Checkout started\")).AtLeast(1) - so a wired-up collector is proven by something the test itself caused. If you want framework request diagnostics, confirm the exact category they log under for your logging configuration first, rather than assuming one. On a Generic Host with its default lifetime, the Microsoft.Hosting.Lifetime \"Application started\" entry after StartAsync is a fine sanity check.",
+ "files": [],
+ "expectations": [
+ "Explains that Microsoft.Hosting.Lifetime is not a reliable sanity check under WebApplicationFactory/ASP.NET Core TestHost",
+ "Attributes the unreliability to TestHost's different host lifetime and/or a shared fixture clearing startup entries between tests",
+ "Recommends asserting a deterministic application-owned entry emitted during the operation under test",
+ "Notes that the Generic Host default lifetime does log Microsoft.Hosting.Lifetime on StartAsync, so the category itself is not wrong",
+ "Does not suggest the collector is broken or that Never() is unreliable when capture is correctly wired"
+ ]
}
]
}
diff --git a/skills/compono/references/logging.md b/skills/compono/references/logging.md
index 24105cae..c5707757 100644
--- a/skills/compono/references/logging.md
+++ b/skills/compono/references/logging.md
@@ -3,7 +3,9 @@
Only relevant if the project references `Compono.Logging`. `UseLogging()`
composes `ILogger`/`ILogger` as a hand-written `CapturingLogger`/
`CapturingLogger`, plus `CapturedLogEntry` and the fluent `Verify()`
-surface.
+surface. A test-owned `LogCollector` + `AddComponoCapture()` captures a
+real Generic Host's *host-wide* output (every category, including
+container-resolved `ILogger` and framework logging).
```csharp
using Compono;
@@ -38,6 +40,11 @@ currently hand-rolls a fake `ILogger`, uses `NullLogger.Instance` and
therefore can't assert anything about logging, or manually
`Register>(...)`s a logger for one specific type.
+Also use it for host-wide assertions against a real Generic Host/
+`WebApplicationFactory` — "nothing logged at `Error` or above anywhere,"
+framework lifetime messages, a container-resolved `ILogger` — via
+`LogCollector` + `AddComponoCapture()` (below).
+
## When NOT to use it
The test doesn't care about logging behavior at all — a bare
@@ -100,7 +107,8 @@ discovered.
`Compono.TestDoubles`/`Compono.Http`'s own `Verify()` vocabulary exactly
— never suggest a two-verb `VerifyLog()...Verify()` shape, that was
explicitly considered and rejected):
- `.AtLevel(level)`, `.WithEventId(id)`, `.WithException()`,
+ `.AtLevel(level)`, `.AtLevelOrAbove(level)`, `.InCategory(category)`,
+ `.WithEventId(id)`, `.WithException()`,
`.WithMessageContaining(text)`, `.Matching(predicate)`, ending in
`.Once()` / `.Never()` / `.Exactly(n)` / `.AtLeast(n)` / `.AtMost(n)` —
each a thin forward through the same shared count-verification semantics
@@ -110,6 +118,82 @@ discovered.
direct construction, no composition required, identical behavior to a
provider-composed instance.
+## Host-wide capture — `LogCollector` + `AddComponoCapture`
+
+Composed loggers only see Compono-composed output. For a real Generic Host
+(or `WebApplicationFactory.ConfigureLogging`, or
+`services.AddLogging(...)`), register a test-owned collector:
+
+```csharp
+var logs = new LogCollector();
+var builder = Host.CreateApplicationBuilder();
+builder.Logging.ClearProviders();
+builder.Logging.AddComponoCapture(logs);
+using var host = builder.Build();
+
+logs.Verify().AtLevelOrAbove(LogLevel.Error).Never();
+// One category: the ILogger type's FULL name, matched exactly.
+logs.Verify().AtLevelOrAbove(LogLevel.Error).InCategory("MyApp.Payments.PaymentGateway").Never();
+// A namespace: match the prefix explicitly.
+logs.Verify().AtLevelOrAbove(LogLevel.Error)
+ .Matching(e => e.Category.StartsWith("MyApp.Payments.", StringComparison.Ordinal)).Never();
+```
+
+Key semantics to get right:
+
+- `Category` is on every `CapturedLogEntry`. Host entries carry the exact
+ `ILoggerProvider.CreateLogger` string; composed/direct `CapturingLogger`
+ matches `LoggerFactory.CreateLogger()`; non-generic `CapturingLogger`
+ and a bare composed `ILogger` carry `""`. `InCategory` is exact, ordinal,
+ case-sensitive — **not** a prefix match, unlike the host's own
+ `AddFilter`/`Logging:LogLevel:*` rules. Never write
+ `InCategory("Payments")`/a namespace with `.Never()`: it matches nothing
+ and passes without checking anything. Use the full category name or
+ `.Matching(e => e.Category.StartsWith(...))`.
+- `Never()`'s failure text names the filters and the match count only
+ (`Expected exactly 0 call(s) to a log entry matching level Error or
+ above, but received 1.`); it does not list entries — read them with
+ `GetCapturedEntries()`.
+- **Behavioral change**: `Category` participates in the record's value
+ equality. Entries differing only by category are not equal. This is
+ intentional (ADR-0071), not a bug to "fix."
+- Host and composed capture are **separate destinations** in this release.
+ A container-resolved `ILogger` is the host's logger: calling
+ `Verify()`/`GetCapturedEntries()` on it still throws
+ `InvalidOperationException`, now pointing at `LogCollector`/
+ `AddComponoCapture`. Never suggest forwarding host output into a composed
+ logger — it doesn't exist yet.
+- The host's own filters still apply: default minimum `Information` means
+ `Debug`/`Trace` are not captured; lower it with
+ `builder.Logging.SetMinimumLevel(LogLevel.Trace)` or `AddFilter`.
+ `AddComponoCapture` never changes filter rules. A
+ `Logging:Compono:LogLevel:*` provider-alias rule targets only the
+ Compono provider, on every supported TFM (net8.0–net11.0; ADR-0071
+ Amendment 2 — don't repeat the old "net10+ only" caveat).
+- The test owns the collector; the host owns the provider. Disposing the
+ host stops capture but never clears the collector — entries stay
+ readable and `ClearCapturedEntries()` still works. Registering the same
+ collector twice is idempotent (and re-registering after `ClearProviders()`
+ adds it back); different collectors each receive every entry; one
+ collector across hosts receives all (disposing one host stops only that
+ host).
+- No size limit: the collector keeps everything until
+ `ClearCapturedEntries()`. A `WebApplicationFactory`/class-fixture
+ collector is shared across tests — clear it at the start of each test.
+- Host scopes come from the host's shared scope provider, so a scope opened
+ on one host logger also appears on entries other categories log inside it.
+- A vacuous pass is the main risk: if the app replaces `ILoggerFactory`
+ (e.g. Serilog `UseSerilog()` without `writeToProviders: true`) or calls
+ `ClearProviders()` after the test's registration, nothing is captured
+ and `Never()` passes. Suggest a sanity assertion that the collector saw a
+ known entry. On a Generic Host with its default lifetime,
+ `logs.Verify().InCategory("Microsoft.Hosting.Lifetime").AtLeast(1)` after
+ `StartAsync` works; under a `WebApplicationFactory`/ASP.NET Core
+ `TestHost`, prefer a deterministic entry the code under test emits
+ (don't rely on framework startup logging — `TestHost` runs a different
+ host lifetime and a shared fixture may clear startup entries between
+ tests).
+
## Structured properties and `MessageTemplate`
`CapturedLogEntry.Properties` (`IReadOnlyList>?`)
@@ -142,8 +226,11 @@ threshold is the whole v1 surface, don't invent a richer one.
1. **Non-Compono.Logging `ILogger`** — `logger.Verify()`/etc. called on
an `ILogger` that isn't a `CapturingLogger`/`CapturingLogger`
(`NullLogger.Instance`, an NSubstitute substitute, a
- `Compono.TestDoubles` double) → `InvalidOperationException` at the
- call site. Usually means registration order is backwards (below).
+ `Compono.TestDoubles` double, or a container-resolved host
+ `ILogger`) → `InvalidOperationException` at the call site. Usually
+ means registration order is backwards (below), or the logger came from
+ a host's `IServiceProvider` — then use `LogCollector`/
+ `AddComponoCapture` instead.
2. **Missing generated activation at runtime** — `LoggingProvider`
recognized a closed `ILogger` request but no generator-discovered
activation exists for that category → a *different*
@@ -218,11 +305,12 @@ belong in an ordinary composition/verification example.
## v1 boundaries — do not invent capability beyond these
-No `ILoggerFactory` composition, no Serilog/provider-specific behavior,
-no test-runner output capture/routing, no DI integration
-(`services.AddCompono...`-style), no cross-scope structured-property
-flattening/searching, no category-string constructor for the non-generic
-`CapturingLogger`, no dependency on
+No *composing/replacing* a host's `ILoggerFactory` (a host *provider*
+capturing into a `LogCollector` via `AddComponoCapture` **is** supported),
+no Serilog/provider-specific behavior, no test-runner output
+capture/routing, no DI-integration package beyond `AddComponoCapture`, no
+cross-scope structured-property flattening/searching, no category-string
+constructor for the non-generic `CapturingLogger`, no dependency on
`Microsoft.Extensions.Diagnostics.Testing`. If asked whether one of these
exists, say plainly that it doesn't rather than improvising a plausible-
looking API.
diff --git a/src/Compono.Logging/CapturedLogEntry.cs b/src/Compono.Logging/CapturedLogEntry.cs
index dd621e96..1f2f0e9c 100644
--- a/src/Compono.Logging/CapturedLogEntry.cs
+++ b/src/Compono.Logging/CapturedLogEntry.cs
@@ -18,6 +18,7 @@ public readonly record struct CapturedLogEntry
/// constructor is rather than a public object-initializer surface.
///
internal CapturedLogEntry(
+ string category,
LogLevel logLevel,
EventId eventId,
Exception? exception,
@@ -28,6 +29,7 @@ internal CapturedLogEntry(
IReadOnlyList