pub struct ServerLogEntry {
pub base: BaseLogEntry,
pub level: SerializableLevel,
pub source: String,
pub user_id: Option<String>,
pub fields: Vec<(String, String)>,
}
Expand description
Server log entry with structured fields ServerLogEntry is used to log structured log entries from the server
The ServerLogEntry
structure contains the following fields:
base
- the base log entrylevel
- the log levelsource
- the source of the log entryuser_id
- the user IDfields
- the structured fields of the log entry
The ServerLogEntry
structure contains the following methods:
new
- create a newServerLogEntry
with specified level and sourcewith_base
- set the base log entryuser_id
- set the user IDfields
- set the fieldsadd_field
- add a field
§Example
use rustfs_obs::ServerLogEntry;
use tracing_core::Level;
let entry = ServerLogEntry::new(Level::INFO, "test_module".to_string())
.user_id(Some("user-456".to_string()))
.add_field("operation".to_string(), "login".to_string());
Fields§
§base: BaseLogEntry
§level: SerializableLevel
§source: String
§user_id: Option<String>
§fields: Vec<(String, String)>
Implementations§
Source§impl ServerLogEntry
impl ServerLogEntry
Trait Implementations§
Source§impl Clone for ServerLogEntry
impl Clone for ServerLogEntry
Source§fn clone(&self) -> ServerLogEntry
fn clone(&self) -> ServerLogEntry
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ServerLogEntry
impl Debug for ServerLogEntry
Source§impl<'de> Deserialize<'de> for ServerLogEntry
impl<'de> Deserialize<'de> for ServerLogEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl LogRecord for ServerLogEntry
impl LogRecord for ServerLogEntry
Source§impl PartialEq for ServerLogEntry
impl PartialEq for ServerLogEntry
Source§impl Serialize for ServerLogEntry
impl Serialize for ServerLogEntry
impl Eq for ServerLogEntry
impl StructuralPartialEq for ServerLogEntry
Auto Trait Implementations§
impl Freeze for ServerLogEntry
impl RefUnwindSafe for ServerLogEntry
impl Send for ServerLogEntry
impl Sync for ServerLogEntry
impl Unpin for ServerLogEntry
impl UnwindSafe for ServerLogEntry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request