pub struct LogEvent {Show 14 fields
pub timestamp_ms: u64,
pub severity: Severity,
pub verbosity: Verbosity,
pub message: String,
pub component: String,
pub module: Option<String>,
pub operation: Option<String>,
pub sensitivity: Sensitivity,
pub application_id: Option<String>,
pub node_id: Option<String>,
pub tenant_id: Option<String>,
pub trace_id: Option<String>,
pub request_id: Option<String>,
pub fields: Vec<LogField>,
}Expand description
Structured operational event passed through the sanitizer before normal sinks.
Fields§
§timestamp_ms: u64Unix timestamp in milliseconds supplied by the caller or clock boundary.
severity: SeverityOperational impact.
verbosity: VerbosityDetail threshold independent from severity.
message: StringHuman-readable message.
component: StringStable subsystem name used for policy overrides.
module: Option<String>Optional source module when the caller has a stable module name.
operation: Option<String>Optional named operation being observed.
sensitivity: SensitivityRequested handling class; a policy can only preserve or reduce detail.
application_id: Option<String>Optional application identity.
node_id: Option<String>Optional node identity.
tenant_id: Option<String>Optional tenant identity.
trace_id: Option<String>Optional trace correlation identifier.
request_id: Option<String>Optional request correlation identifier.
fields: Vec<LogField>Extra bounded structured values.
Implementations§
Source§impl LogEvent
impl LogEvent
Sourcepub fn new(
timestamp_ms: u64,
severity: Severity,
verbosity: Verbosity,
component: impl Into<String>,
message: impl Into<String>,
) -> LogEvent
pub fn new( timestamp_ms: u64, severity: Severity, verbosity: Verbosity, component: impl Into<String>, message: impl Into<String>, ) -> LogEvent
Creates a normal operational event without allocating optional metadata.
Sourcepub fn field(self, key: impl Into<String>, value: impl Into<String>) -> LogEvent
pub fn field(self, key: impl Into<String>, value: impl Into<String>) -> LogEvent
Adds one structured field.
Sourcepub fn path(self, key: impl Into<String>, value: impl Into<String>) -> LogEvent
pub fn path(self, key: impl Into<String>, value: impl Into<String>) -> LogEvent
Adds one path field which is alias-sanitized by normal policies.
Sourcepub fn secret(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> LogEvent
pub fn secret( self, key: impl Into<String>, value: impl Into<String>, ) -> LogEvent
Adds one secret field which ordinary policies redact before dispatch.
Sourcepub fn module(self, module: impl Into<String>) -> LogEvent
pub fn module(self, module: impl Into<String>) -> LogEvent
Adds the stable source module without inferring it from compiler state.
Sourcepub fn operation(self, operation: impl Into<String>) -> LogEvent
pub fn operation(self, operation: impl Into<String>) -> LogEvent
Adds a bounded caller-defined operation name.
Sourcepub fn sensitivity(self, sensitivity: Sensitivity) -> LogEvent
pub fn sensitivity(self, sensitivity: Sensitivity) -> LogEvent
Requests a handling class; sensitive delivery still requires a policy.
Sourcepub fn validate(&self) -> Result<(), LogEventError>
pub fn validate(&self) -> Result<(), LogEventError>
Validates bounded event storage before sanitization and sink I/O.
Sourcepub fn retained_bytes(&self) -> usize
pub fn retained_bytes(&self) -> usize
Estimates retained heap bytes without serializing or allocating.