PhoenixGenApi.Tracer.LogCapture (PhoenixGenApi v2.23.1)

Copy Markdown View Source

Logger handler that captures raw log lines for traced requests.

While a process is executing a traced request, it carries the phoenix_gen_api_trace metadata (a list of {kind, key} targets) set by PhoenixGenApi.Tracer.begin_trace/1. Every Logger event emitted by such a process is forwarded to the PhoenixGenApi.Tracer writer, which appends it to the matching per-key trace files as an event=log line.

This handler is transparent: it forwards events to other handlers and does not modify or drop them.

This module also exposes the console_filter/2 used on the default console handler. When the tracer raises the primary log level to capture debug/info output for traced requests, that filter keeps untraced low-level messages from flooding the console.

Summary

Functions

Filter installed on the :default console handler while the tracer is running.

Functions

console_filter(event, arg2)

Filter installed on the :default console handler while the tracer is running.

When the tracer raises the primary log level to its capture level, this filter stops messages below the application's normal log level unless they belong to a traced request (they carry phoenix_gen_api_trace metadata).