Principle:Sdv dev SDV Synthesizer Event Logging
| Knowledge Sources | |
|---|---|
| Domains | Logging, Observability |
| Last Updated | 2026-02-14 19:00 GMT |
Overview
Principle that defines how synthesizer lifecycle events are logged in a structured CSV format for observability and debugging.
Description
Synthesizer Event Logging captures key lifecycle events (Fit, Sample, Save, Load) from SDV synthesizers into structured CSV log files. Each log record contains the event type, timestamp, synthesizer class and instance ID, and data shape metrics (tables, rows, columns). The logging system uses Python's standard logging module with a custom CSV formatter, supports configurable handlers (file or console), and gracefully degrades to a null handler when file permissions are unavailable. Logger instances are cached for performance.
Usage
Apply this principle when observability into synthesizer behavior is needed. The structured CSV output enables programmatic analysis of synthesizer usage patterns, performance profiling, and debugging.
Theoretical Basis
Structured event logging follows the structured logging pattern where log records are emitted as key-value pairs (rather than free-text messages) that can be parsed and analyzed programmatically:
Pseudo-code:
# Structured logging pattern
record = {
'EVENT': event_type,
'TIMESTAMP': now(),
'SYNTHESIZER CLASS NAME': cls.__name__,
'SYNTHESIZER ID': instance_id,
'TOTAL NUMBER OF ROWS': data.shape[0],
}
logger.info(record) # Formatted as CSV row by CSVFormatter