Log to UNIX

    0

    0

    Giovanny Gongora

    Codiga's Rust Recipes

    save log in Unix syslog

    use syslog::{Facility, Error};
    fn main() -> Result<(), Error> {
      syslog::init(Facility::LOG_USER,
        log::LevelFilter::Debug,
        Some("My app name"))?;
      log::debug!("this is a debug {}", "message");
      log::error!("this is an error!");
      Ok(())
    }
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.