LogCaptureInstallation

A live log-capture installation — the LogCapture core plus the way to stop it.

Returned by installLogCapture. Hold it for as long as capture should run, then close it to uninstall. close() is the way to stop capture — cancelling the install scope alone is not sufficient: it kills the drain coroutine but leaves the capturing appender wired into the global logging config, still accepting and queueing every subsequent log line into a channel nobody drains. Since #2124 that queue is bounded, so the cost is no longer unbounded heap: it is that capture is silently doing nothing useful while still charging the application its edge cost, with health's droppedEvents climbing by one per line once the queue is full. Bounded waste is still waste — close.

Properties

Link copied to clipboard

The installed capture core (event → LogRecord → exporter).

Link copied to clipboard
val health: StateFlow<CaptureHealth>

Out-of-band health for the capture edge — see CaptureHealth.

Functions

Link copied to clipboard
open override fun close()

Uninstall capture: restore the previously-installed appender (and logger factory) and stop the capturing appender so it accepts and buffers no more events. Idempotent — safe to call more than once.