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

Logging setup of MZoon Application via MoonZoon.toml #69

Open
serasera33 opened this issue Feb 23, 2022 · 0 comments
Open

Logging setup of MZoon Application via MoonZoon.toml #69

serasera33 opened this issue Feb 23, 2022 · 0 comments

Comments

@serasera33
Copy link

At the moment, the default logger is env_logger, which can only be used by adding the following line into backend/src/main.rs

#[moon::main]
async fn main() -> std::io::Result<()> {
    std::env::set_var("RUST_LOG", "backend=debug");

It would be great if one could choose the app logger and logging level from the MoonZoon.toml file. This logging is separate from the MoonZoon or Actix logging and reserved for the app itself. One could configure different loggers, for eg log4rs or syslog, needs depending. For eg.

app_backend_logger = "log4rs"
app_backend_logger_config = "mylog4rs.yml"
app_backend_loglevel = "info"

Some users might want frontend logging as well (eg the console_log crate) for logging in the browser console. For eg.

app_frontend_logger = "console.log"
app_frontend_loglevel = "warn"
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

1 participant