mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-05-27 14:03:57 +00:00
Add config option for log timestamp format
This commit is contained in:
parent
11845d9f5b
commit
d348f12a0e
3 changed files with 8 additions and 2 deletions
|
@ -329,6 +329,8 @@ make_config! {
|
|||
reload_templates: bool, true, def, false;
|
||||
/// Enable extended logging
|
||||
extended_logging: bool, false, def, true;
|
||||
/// Log timestamp format
|
||||
log_timestamp_format: String, true, def, "%Y-%m-%d %H:%M:%S".to_string();
|
||||
/// Enable the log to output to Syslog
|
||||
use_syslog: bool, false, def, false;
|
||||
/// Log file path
|
||||
|
|
|
@ -130,8 +130,8 @@ fn init_logging(level: log::LevelFilter) -> Result<(), fern::InitError> {
|
|||
if CONFIG.extended_logging() {
|
||||
logger = logger.format(|out, message, record| {
|
||||
out.finish(format_args!(
|
||||
"{}[{}][{}] {}",
|
||||
chrono::Local::now().format("[%Y-%m-%d %H:%M:%S]"),
|
||||
"[{}][{}][{}] {}",
|
||||
chrono::Local::now().format(&CONFIG.log_timestamp_format()),
|
||||
record.target(),
|
||||
record.level(),
|
||||
message
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue