mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-06-01 00:13:56 +00:00
Implement log_level config option
This commit is contained in:
parent
c384f9c0ca
commit
2475c36a75
3 changed files with 10 additions and 1 deletions
|
@ -277,6 +277,8 @@ make_config! {
|
|||
extended_logging: bool, false, def, true;
|
||||
/// Log file path
|
||||
log_file: String, false, option;
|
||||
/// Log level
|
||||
log_level: String, false, def, "Info".to_string();
|
||||
|
||||
/// Enable DB WAL |> Turning this off might lead to worse performance, but might help if using bitwarden_rs on some exotic filesystems,
|
||||
/// that do not support WAL. Please make sure you read project wiki on the topic before changing this setting.
|
||||
|
|
|
@ -69,6 +69,7 @@ fn launch_info() {
|
|||
}
|
||||
|
||||
fn init_logging() -> Result<(), fern::InitError> {
|
||||
use std::str::FromStr;
|
||||
let mut logger = fern::Dispatch::new()
|
||||
.format(|out, message, record| {
|
||||
out.finish(format_args!(
|
||||
|
@ -79,7 +80,7 @@ fn init_logging() -> Result<(), fern::InitError> {
|
|||
message
|
||||
))
|
||||
})
|
||||
.level(log::LevelFilter::Info)
|
||||
.level(log::LevelFilter::from_str(&CONFIG.log_level()).expect("Valid log level"))
|
||||
// Hide unknown certificate errors if using self-signed
|
||||
.level_for("rustls::session", log::LevelFilter::Off)
|
||||
// Hide failed to close stream messages
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue