Oninit® 4gl2everywhere — Logging
The logger is thread-safe and self-rotating. A single logger object serves the whole process; per-listener overrides allow per-listener log files when one bridge process fronts heterogeneous backends and operators want their streams separate.
Levels
| Level | Content |
|---|---|
| normal | Operational events: listener bound, session start / end, error categories. |
| verbose | Adds per-token summaries on session activity, decoded LOGIN fields (excluding password), per-request token names. |
| debug | Adds protocol-level traces, full token dispatch flow, codec capability negotiation. |
| sqltrace | SQL-only mode — suppresses operational logging in favour of high-volume SQL trace. |
CLI overrides
The level set in YAML is the baseline. CLI flags override at startup: -v verbose, -d debug, -s sqltrace. Priority runs debug > sqltrace > verbose > config — the most-detailed flag wins.
Rotation
Rotation is config-driven: a max file size in MB, a max kept-files count, and an optional compression flag. The logger checks size on every write; on rollover the active file is renamed with a numeric suffix and a fresh file opens. Compressed older files use gzip.
Per-listener log files
Each listener may declare its own logfile override; when present, that listener's events flow to its own file. Field-level fallback applies: a listener can override only the file path while inheriting global level / rotation. Reload via SIGHUP without dropping sessions.