Logging System

KeyValue
StatusActive
OwnerQA Automation
Updated2026-03-26
ScopeEventLogger, reporter records, artifacts, and how run evidence is stored

The logging system is the backbone of everything else in PW-Tests. If you understand what gets written, you understand why Slack can be more informative, why Grafana can answer useful questions, and why failure history can improve over time.

What The Logging System Is For

GoalWhy It Matters
preserve run evidencefailures should be debuggable after the fact
support operatorshumans need summaries and artifacts
support automationscripts need structured records, not just console text
support historyrecurrence, priors, and trends depend on stored data

Main Parts

PartWhat It Produces
EventLoggerstructured event stream
reportertest summaries, screenshot records, step records
local artifactslogs, traces, screenshots, run files
OpenSearchdurable searchable telemetry
history filesrecurrence and recovery memory

EventLogger

The EventLogger replaced the older split logging model. It now acts as the common event pipeline across the suites that support it.

EventLogger CharacteristicWhy It Helps
buffered writesavoids noisy per-event file churn
local plus remote outputworks locally, scales in CI
shared identifierslinks events to reporter records and runs
schema versioningmakes data evolution safer
%%{init: {'theme':'base', 'themeVariables': {'primaryColor': '#4a90d9', 'primaryTextColor': '#fff', 'primaryBorderColor': '#2c6fad', 'lineColor': '#555', 'fontFamily': 'sans-serif'}}}%%
flowchart LR
    TEST["Test run"] --> EL["EventLogger\nbuffered in-memory"]
    EL --> JSONL["JSONL logs\ntest-results/logs/"]
    EL --> OS["OpenSearch\ncncqa_tests-*\ncncqa_events-*"]
    OS --> GR["Grafana dashboards\nhuman-readable panels"]
    OS --> DASH["Control Center\nlocalhost:3001"]
    JSONL --> HEAL["Healer\nfailure triage"]
    JSONL --> FACT["Visual fact-checker\nscreenshot review"]

The diagram shows how EventLogger feeds both local JSONL files and remote OpenSearch, and how downstream consumers read from each store.

Reporter Output

The reporter adds the human-facing layer used by Grafana and some Slack/reporting workflows.

Reporter OutputTypical Use
test recordssuite and failure dashboards
screenshot recordsvisual context in investigation
step recordsreconstructing what happened before failure
merged run result dataCI notifications and reports

Where Evidence Lives

Path Or StoreContents
test-results/logs/structured local event logs
test-results/artifacts/per-test failure artifacts
test-results/results.jsonmerged run result summary
test-results/history/run history used for recurrence logic
OpenSearch cncqa_tests-*human-facing records
OpenSearch cncqa_events-*event stream records

Why Structured Logging Matters

Structured records make these workflows possible:

  • classify failures by shape instead of only by error text
  • detect repeated failures across days
  • feed Grafana with consistent fields
  • match a new failure against known incidents
  • decide whether a thread should receive a recovery reply

Common Record Types

Record FamilyExamples
run-levelstart, end, summary, duration
test-levelpass, fail, skip, retry
step-levelaction, navigation, selector interaction
evidence-levelscreenshot and trace linkage
enrichment-levelcategory, severity, cause assessment

Human And Machine Consumers

ConsumerWhat It Reads
Slack alertsmerged results, failure summaries, history
Grafanatest records, screenshots, step records
observability scriptsOpenSearch queries and quality signals
healing workflowslocal logs, history, fix memory
operatorsartifacts, traces, screenshots, markdown runbooks

Logging Gotchas Worth Remembering

GotchaWhy It Matters
old and new data may coexist in shared indicesaggregate queries can be misleading if they mix generations
some workflows need direct OpenSearch accessnot every index or admin task should go through the Grafana proxy
visual failures and artifact-heavy suites need special handlingscreenshots are useful, but artifact bloat is real
history files matterrecurrence features degrade if history is missing or not merged correctly
SituationBest Evidence
single failing testartifacts plus local logs
repeated nightly failurehistory plus incident store
dashboard looks wrongOpenSearch records plus dashboard validation
flaky interactionstep records and trace
confusing Slack alertmerged results and notifier logic

Bottom Line

PW-Tests logging is not there for posterity. It is there to shorten the time between “something failed” and “we know what to do next.”