Struct opentelemetry_api::logs::LogRecord
source · #[non_exhaustive]pub struct LogRecord {
pub timestamp: Option<SystemTime>,
pub observed_timestamp: Option<SystemTime>,
pub trace_context: Option<TraceContext>,
pub severity_text: Option<Cow<'static, str>>,
pub severity_number: Option<Severity>,
pub body: Option<AnyValue>,
pub attributes: Option<Vec<(Key, AnyValue)>>,
}
Expand description
LogRecord represents all data carried by a log record, and
is provided to LogExporter
s as input.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.timestamp: Option<SystemTime>
Record timestamp
observed_timestamp: Option<SystemTime>
Timestamp for when the record was observed by OpenTelemetry
trace_context: Option<TraceContext>
Trace context for logs associated with spans
severity_text: Option<Cow<'static, str>>
The original severity string from the source
severity_number: Option<Severity>
The corresponding severity value, normalized
body: Option<AnyValue>
Record body
attributes: Option<Vec<(Key, AnyValue)>>
Additional attributes associated with this record
Implementations§
source§impl LogRecord
impl LogRecord
sourcepub fn builder() -> LogRecordBuilder
pub fn builder() -> LogRecordBuilder
Create a LogRecordBuilder
to create a new Log Record
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for LogRecord
impl Send for LogRecord
impl Sync for LogRecord
impl Unpin for LogRecord
impl UnwindSafe for LogRecord
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