pub struct LoggerConfig {
pub level: String,
pub directives: Option<String>,
pub file: Option<String>,
pub sql: bool,
pub format: LogFormat,
}Expand description
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 more