1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// SPDX-License-Identifier: Apache-2.0
// Copyright 2026 ZeroDDS Contributors
//! Crate `zerodds-security-logging`. Safety classification: **SAFE** (a pure I/O wrapper; no secrets are buffered outside the log line itself).
//!
//! Production-grade logging backends for DDS-Security 1.1/1.2 §8.6
//! (the `LoggingPlugin` SPI from `zerodds-security`).
//!
//! ## Layer position
//!
//! Layer 4 — Core Services. Consumed by end-user builds + the DCPS runtime
//! (feature `security`).
//!
//! ## Public API (as of 1.0.0-rc.1)
//!
//! - [`StderrLoggingPlugin`] — structured log lines to `stderr`.
//! - [`JsonLinesLoggingPlugin`] — `application/x-ndjson` to a file.
//! - [`SyslogLoggingPlugin`] — RFC-5424 UDP backend (facility `LOCAL0`).
//! - [`FanOutLoggingPlugin`] — fan-out to multiple backends.
//!
//! # What this crate provides
//!
//! 1. [`StderrLoggingPlugin`] — writes structured log lines to
//! `stderr`. Default for development + container deployments with a
//! stdout/stderr collector (Loki, Vector, Fluentd).
//! 2. [`JsonLinesLoggingPlugin`] — writes JSON lines
//! (`application/x-ndjson`) to a file. Each line = one event.
//! A second process (e.g. auditd, filebeat) rotates the file.
//! 3. [`FanOutLoggingPlugin`] — routes each event to **multiple**
//! backends (e.g. stderr + JSON file simultaneously).
//!
//! All backends filter events by `LogLevel`; the default level is
//! `Warning` — lower (Informational, Debug) is silently discarded.
//!
//! ## Non-goals
//!
//! - Syslog TCP (RFC 5425) and syslog TLS — most syslog
//! deployments run in a trusted segment; re-add on demand.
//! - Structured telemetry (OpenTelemetry / OTLP) — covered by
//! `zerodds-observability-otlp` (layer 4.6).
//! - Log rotation in the plugin itself — the job of the operating system /
//! `logrotate`.
// Three plugin impls for box polymorphism — SPI-driven.
// zerodds-lint: allow no_dyn_in_safe
extern crate alloc;
pub use FanOutLoggingPlugin;
pub use ;
pub use JsonLinesLoggingPlugin;
pub use StderrLoggingPlugin;
pub use SyslogLoggingPlugin;