MoonZoon
MoonZoon copied to clipboard
Logging setup of MZoon Application via MoonZoon.toml
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"