ADR-013: Structured Logging Framework (Nebula Logger)
Status
Accepted. Amended 2026-10-21 (see below).
Context
Requirement for persistent logs even during Apex transaction rollbacks.
Decision
Adopt the Nebula Logger open-source framework.
Rationale
Uses Platform Events for decoupled log persistence and provides a unified adapter for LWC and Apex.
Implications
Requires a strict 2-day retention policy to manage storage limits in Developer Edition.
Amendment (2026-10-21): an optional install behind a seam
Nebula Logger is an optional dependency I install, reached through a seam (my decision, 2026-10-21).
- I install Nebula Logger’s unlocked, no-namespace package in production by hand. It is not in source, CI and scratch orgs run without it, and no source file names a Nebula type.
PortfolioLogis the seam. It looks up Nebula’sSystem.Callableentry point,CallableLogger, at run time withType.forName(with or without theNebulanamespace) and sends each line through itsnewEntryaction with the tagportfolio. When Nebula is absent, or the call fails, the line goes toSystem.debug, and a logging failure never reaches the caller.- Every API request writes one line,
api request path=<path> status=<status> correlationId=<id> elapsedMs=<ms>, throughRequestUtil.logRequest, after the response is written (ApiRequestContext). The path loses its query string, and no body, header value or token is logged. The site cover letter writes the same line with the pathaura:ApiLabController.generateCoverLetter. - Retention stays 2 days, as my setting in Nebula once it is installed.