pub struct LogConfig {
pub level: LogLevel,
pub output: LogOutput,
pub trace_correlation: bool,
pub include_timestamps: bool,
pub include_location: bool,
pub include_thread_id: bool,
pub module_levels: HashMap<String, LogLevel>,
pub service_name: String,
pub environment: String,
pub global_fields: HashMap<String, String>,
}Expand description
Configuration for structured logging.
Fields§
§level: LogLevelDefault log level.
output: LogOutputOutput format.
trace_correlation: boolEnable trace correlation.
include_timestamps: boolInclude timestamps.
include_location: boolInclude caller location (file:line).
include_thread_id: boolInclude thread ID.
module_levels: HashMap<String, LogLevel>Per-module log levels.
service_name: StringService name for structured logs.
environment: StringEnvironment (dev, staging, prod).
global_fields: HashMap<String, String>Custom fields added to every log.
Implementations§
Source§impl LogConfig
impl LogConfig
Sourcepub fn builder() -> LogConfigBuilder
pub fn builder() -> LogConfigBuilder
Create a new builder.
Sourcepub fn development() -> Self
pub fn development() -> Self
Create a development configuration.
Sourcepub fn production() -> Self
pub fn production() -> Self
Create a production configuration.
Sourcepub fn effective_level(&self, module: &str) -> LogLevel
pub fn effective_level(&self, module: &str) -> LogLevel
Get effective log level for a module.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LogConfig
impl RefUnwindSafe for LogConfig
impl Send for LogConfig
impl Sync for LogConfig
impl Unpin for LogConfig
impl UnwindSafe for LogConfig
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.