pub struct LoggerConfig {
pub level: String,
pub directives: Option<String>,
pub file: Option<String>,
pub sql: bool,
pub format: LogFormat,
}Expand description
Re-exported so config::LoggerConfig resolves; the logger config lives in
doido-core alongside the logger it drives. The model layer reads it for the
sql toggle (whether sea-orm logs each statement).
Logging settings, deserialized from the logger section of
config/<env>.yml.
The application log level is combined with the framework’s
NOISE_DIRECTIVES to build the tracing EnvFilter; set directives to
take full control of the filter string instead. When file is set, log
output is appended to that path (relative to the project root) instead of
stdout. sql toggles sea-orm’s SQL statement logging. format selects the
output renderer (LogFormat).
Fields§
§level: StringBase application log level: trace, debug, info, warn, or error.
directives: Option<String>Optional full EnvFilter directive string. When set it fully replaces
the directives derived from level (and the built-in noise reduction),
e.g. info,my_app=debug,sqlx=warn.
file: Option<String>Optional path to redirect log output to (appended, ANSI colours off). Parent directories are created as needed. When unset, logs go to stdout.
sql: boolWhether sea-orm logs each SQL statement (target sqlx::query). Defaults
to true; set false to silence query logging at the source.
format: LogFormatOutput renderer: compact (default), verbose, or json_response.
Implementations§
Source§impl LoggerConfig
impl LoggerConfig
Sourcepub fn directives(&self) -> String
pub fn directives(&self) -> String
Resolves the EnvFilter directive string used as the fallback when
RUST_LOG is unset: the explicit directives override if present;
otherwise, for LogFormat::JsonResponse, a filter isolating the
RESPONSE_TARGET; otherwise the directives built from level.
Trait Implementations§
Source§impl Clone for LoggerConfig
impl Clone for LoggerConfig
Source§fn clone(&self) -> LoggerConfig
fn clone(&self) -> LoggerConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LoggerConfig
impl Debug for LoggerConfig
Source§impl Default for LoggerConfig
impl Default for LoggerConfig
Source§fn default() -> LoggerConfig
fn default() -> LoggerConfig
Source§impl<'de> Deserialize<'de> for LoggerConfig
impl<'de> Deserialize<'de> for LoggerConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<LoggerConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<LoggerConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for LoggerConfig
impl RefUnwindSafe for LoggerConfig
impl Send for LoggerConfig
impl Sync for LoggerConfig
impl Unpin for LoggerConfig
impl UnsafeUnpin for LoggerConfig
impl UnwindSafe for LoggerConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more