pub struct FmtLayer {Show 15 fields
pub filter: Option<String>,
pub writer: String,
pub formatter: FmtLayerFormatter,
pub span_events: SpanEvents,
pub ansi: bool,
pub time: Option<bool>,
pub level: Option<bool>,
pub target: Option<bool>,
pub file: Option<bool>,
pub line_number: Option<bool>,
pub thread_ids: Option<bool>,
pub thread_names: Option<bool>,
pub span_list: Option<bool>,
pub current_span: Option<bool>,
pub flatten_event: Option<bool>,
}Expand description
fmt Layer (see docs) configuration.
§Example
# declare a layer named "app"
[layer.app]
type = "fmt"
writer = "my_file" # must be a declared writer
formatter = "pretty" # can be : "full", "compact", "pretty", "json"
span_events = "none" # can be : "new", "enter", "exit", "close", "none", "active", "full"
ansi = false # color terminal
# the following properties are optional
filter = "only_app" # must be a named filter
time = true
level = true
target = true
file = true
line_number = true
thread_ids = true
thread_names = true
span_list = true # for "json" formatter only
current_span = true # for "json" formatter only
flatten_event = true # for "json" formatter onlyFields§
§filter: Option<String>Applies a per Layer filter, makes this a Filtered Layer
writer: StringWhere does the output go
formatter: FmtLayerFormatterFormatting kind/type
span_events: SpanEventsWhich span events should be recorded
ansi: boolAnsi color escape codes (for color terminal) recommend to disable if writer is file
time: Option<bool>Record time
level: Option<bool>Record level
target: Option<bool>Record span/event target
file: Option<bool>Record source file
line_number: Option<bool>Record source file line number
thread_ids: Option<bool>Record thread id
thread_names: Option<bool>Record thread name
span_list: Option<bool>Record span list (json formatter only)
current_span: Option<bool>Record current span (json formatter only)
flatten_event: Option<bool>Flatten json output (json formatter only)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FmtLayer
impl<'de> Deserialize<'de> for FmtLayer
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
impl Eq for FmtLayer
impl StructuralPartialEq for FmtLayer
Auto Trait Implementations§
impl Freeze for FmtLayer
impl RefUnwindSafe for FmtLayer
impl Send for FmtLayer
impl Sync for FmtLayer
impl Unpin for FmtLayer
impl UnsafeUnpin for FmtLayer
impl UnwindSafe for FmtLayer
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.