pub struct StructuredContext {Show 19 fields
pub request_id: String,
pub parent_request_id: Option<String>,
pub correlation_id: String,
pub service_name: String,
pub service_version: String,
pub instance_id: String,
pub tool_name: String,
pub tool_version: Option<String>,
pub client_id: Option<String>,
pub user_agent: Option<String>,
pub session_id: Option<String>,
pub start_time: Instant,
pub start_timestamp: u64,
pub loxone_host: Option<String>,
pub loxone_version: Option<String>,
pub room_name: Option<String>,
pub device_uuid: Option<String>,
pub device_type: Option<String>,
pub custom_fields: HashMap<String, Value>,
}
Expand description
Structured logging context with rich observability fields
Fields§
§request_id: String
Request tracking
parent_request_id: Option<String>
§correlation_id: String
§service_name: String
Service identification
service_version: String
§instance_id: String
§tool_name: String
Request metadata
tool_version: Option<String>
§client_id: Option<String>
§user_agent: Option<String>
§session_id: Option<String>
§start_time: Instant
Performance metrics
start_timestamp: u64
§loxone_host: Option<String>
Loxone-specific context
loxone_version: Option<String>
§room_name: Option<String>
§device_uuid: Option<String>
§device_type: Option<String>
§custom_fields: HashMap<String, Value>
Custom fields for business logic
Implementations§
Source§impl StructuredContext
impl StructuredContext
Sourcepub fn with_loxone_context(self, host: String, version: Option<String>) -> Self
pub fn with_loxone_context(self, host: String, version: Option<String>) -> Self
Add Loxone-specific context
Sourcepub fn with_device_context(
self,
device_uuid: String,
device_type: Option<String>,
room_name: Option<String>,
) -> Self
pub fn with_device_context( self, device_uuid: String, device_type: Option<String>, room_name: Option<String>, ) -> Self
Add device context
Sourcepub fn with_client_context(
self,
client_id: String,
user_agent: Option<String>,
session_id: Option<String>,
) -> Self
pub fn with_client_context( self, client_id: String, user_agent: Option<String>, session_id: Option<String>, ) -> Self
Add client context
Sourcepub fn with_field<K: ToString, V: Into<Value>>(self, key: &K, value: V) -> Self
pub fn with_field<K: ToString, V: Into<Value>>(self, key: &K, value: V) -> Self
Add custom field
Sourcepub fn elapsed_ms(&self) -> u64
pub fn elapsed_ms(&self) -> u64
Get elapsed time in milliseconds
Trait Implementations§
Source§impl Clone for StructuredContext
impl Clone for StructuredContext
Source§fn clone(&self) -> StructuredContext
fn clone(&self) -> StructuredContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for StructuredContext
impl RefUnwindSafe for StructuredContext
impl Send for StructuredContext
impl Sync for StructuredContext
impl Unpin for StructuredContext
impl UnwindSafe for StructuredContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more