Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

should print error message to console but did not . #389

Open
nich0las opened this issue Aug 28, 2024 · 1 comment
Open

should print error message to console but did not . #389

nich0las opened this issue Aug 28, 2024 · 1 comment

Comments

@nich0las
Copy link

log4rs.yml:

refresh_rate: 5 seconds

appenders:
console:
kind: console
encoder:
pattern: "{d(%+)(local)} [{t}] {h({l})} {M}:{m}{n}"
filters:
- kind: threshold
level: error
file:
kind: file
path: info.log
encoder:
pattern: "{d} [{t}] {l} {M}:{m}{n}"

root:
appenders:

  • file

loggers:
multi_logger_config:
level: error
appenders:
- console
additive: true

main.rs:
use log::{error, info};

fn main() {
log4rs::init_file("config/log4rs.yml", Default::default()).unwrap();
error!("error");
info!("hello");
println!("println");
}

expected: error message in console but i can't find error message

@bconn98
Copy link
Collaborator

bconn98 commented Sep 8, 2024

You only have the file appender listed under your root::appenders. If you need help with the configuration, please review the documentation and give it another go. We can lend a hand, and maybe improve the docs, if you're still having trouble after reviewing them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants